Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ocean albedos for UFS #395

Merged
merged 29 commits into from
Aug 11, 2023
Merged

Conversation

DeniseWorthen
Copy link
Collaborator

@DeniseWorthen DeniseWorthen commented Jul 27, 2023

Description of changes

Allow UFS to use the ocean albedo calculation in CMEPS. In order to implement in UFS several new config options were added. These are required to allow UFS to set non-standard albdir and albdif values and to set a minimum value of ocean albedo (required for consistency w/ FV3ATM). A new logical is also required to use the clock rather than the nextswCday scalar variable (UFS ATM component does not have this scalar value attached).

Includes minor UFS updates for

  • mapping type of WAV->ATM
  • using evaporative flux from ATM
  • ufs/ccpp modules

Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial)

  • no answer changes are expected for CESM

Any User Interface Changes (namelist or namelist defaults changes)?

Testing performed

Please describe the tests along with the target model and machine(s)
If possible, please also added hashes that were used in the testing

This changes answers for UFS, but also allows backward (non-b4b) ocean albedos to be used (when flux_ablav=.true., albdir=albdif=0.06). It has been tested and verified to provide a better estimate of net SW to the ocean in UFS.

DeniseWorthen and others added 23 commits February 1, 2023 12:09
* Corrected type for 2-m dewpoint.

* Corrected type of variables diag_flux and diag_log.

* Match von_karman_constant name with Physcons.

---------

Co-authored-by: tanyasmirnova <tanya.smirnova@noaa.gov>
* remove swnet to ocean from custom_nems
* set optional use of nextswday
* get med history working w/o aofluxes
* flux_albav moved to _init
* use_nextswcday for using clock instead of scalar field
* min_albedo for setting min albedo used max(min_albedo,....)
* giving a min_albedo value sets logical use_min_albedo, otherwise
false and min_albedo=0
* set mean albdif and albdir via config. If not present, defaults to
current values
* atm sends evap directly
@DeniseWorthen
Copy link
Collaborator Author

I marked this as draft to allow ESCOMP time to review and me to test any changes requested. Cheyenne is down next week, so I know testing for ESCOMP may be delayed.

mediator/med_io_mod.F90 Outdated Show resolved Hide resolved
mediator/med_phases_prep_ocn_mod.F90 Outdated Show resolved Hide resolved
Copy link
Collaborator

@mvertens mvertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I think the key thing is to test this within CESM to make sure that everything is bfb. Also - it would be good to not have the aoflux check also determine the ocnalb check - but that needs CESM testing to determine if that is okay.

mediator/med.F90 Show resolved Hide resolved
mediator/med_io_mod.F90 Outdated Show resolved Hide resolved
@@ -275,8 +329,9 @@ subroutine med_phases_ocnalb_run(gcomp, rc)

! Determine if ocnalb data type will be initialized - and if not return
if (first_call) then
if ( ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_aoflux_a, rc=rc) .and. &
ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_aoflux_o, rc=rc)) then
if ((ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_aoflux_a, rc=rc) .and. &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to test in CESM if we could also just use to check for ocnalb_o - and not for aoflux_a and aoflux_o - that would make this a lot more clean.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvertens I've made a change here (and below) to only check for FB_ocnalb_o, which I agree is much cleaner. I've tested it in two cases on our side, using ocnalb with and w/o aoflux and it works on our end. I do agree it needs testing to verify it won't break something for CESM.

@@ -430,18 +495,28 @@ subroutine med_phases_ocnalb_run(gcomp, rc)
ofrad(:) = ofrac(:)
endif

! Write mediator ocnalb history if aofluxes are not active
if ( ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_ocnalb_o, rc=rc) .and. &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above in terms of just checking for ocnalb_o for CESM -and removing the check for aoflux_a and aoflux_o.

@@ -529,8 +528,9 @@ subroutine med_phases_prep_ocn_custom_cesm(gcomp, rc)
ifracr_scaled = ifracr(n) / (frac_sum)
ofracr_scaled = ofracr(n) / (frac_sum)
endif
Foxx_swnet(n) = ofracr_scaled*(fswabsv + fswabsi) + ifrac_scaled*Fioi_swpen(n)

if (.not.import_swpen_by_bands) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. This should also be checked in testing.

@DeniseWorthen DeniseWorthen marked this pull request as ready for review August 4, 2023 12:38
@DeniseWorthen
Copy link
Collaborator Author

Cheyenne now back on line, so I'm opening the PR for CESM testing. Thanks!

@jedwards4b
Copy link
Collaborator

@DeniseWorthen I'm running cesm tests on cheyenne now. Can I push to your branch to fix the github test?

@DeniseWorthen
Copy link
Collaborator Author

@jedwards4b Yes, that would be fine.

@jedwards4b
Copy link
Collaborator

@DeniseWorthen

ERROR: Permission to DeniseWorthen/CMEPS.git denied to jedwards4b.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@DeniseWorthen
Copy link
Collaborator Author

Sorry about that. I've added you now.

@jedwards4b
Copy link
Collaborator

I have a number of fully coupled and G tests failing. Here is an example:

run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.cice.h.0003-01-19.nc.base.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.cice.h.0003-01-19.nc.cprnc.out:          of which     87 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.cpl.hi.0003-01-20-00000.nc.base.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.cpl.hi.0003-01-20-00000.nc.cprnc.out:          of which    104 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.pop.h.0003-01-19.nc.base.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.pop.h.0003-01-19.nc.cprnc.out:          of which    109 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.pop.hv.nc.base.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.pop.hv.nc.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.ww3.hi.0003-01-20-00000.nc.base.cprnc.out:          of which      0 had non-zero differences
run/ERI.T62_g37.G.cheyenne_intel.pop-cice.C.20230804_083150_9bhvwx.ww3.hi.0003-01-20-00000.nc.cprnc.out:          of which      3 had non-zero differences

@DeniseWorthen
Copy link
Collaborator Author

@jedwards4b I've reverted the change to swnet in prep_ocn (swnet is calculated regardless of whether import_by_bands is true or false). Could you please test again? Thanks.

@jedwards4b
Copy link
Collaborator

I did rerun a subset of tests and this did fix the problem. I'm sorry I forgot to let you know. @DeniseWorthen

@jedwards4b jedwards4b merged commit b751891 into ESCOMP:main Aug 11, 2023
2 checks passed
@DeniseWorthen
Copy link
Collaborator Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WIP: implement ocean albedo calculation for UFS are the correct FBs being checked for in ocnalb routine?
5 participants