Skip to content

Commit

Permalink
changes to add compatibility with NorESM requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana Vertenstein committed Mar 29, 2024
1 parent ea966dd commit c223a3c
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 2 deletions.
10 changes: 10 additions & 0 deletions cime_config/runseq/driver_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ def __compute_glc(self, case, coupling_times):
glc_coupling_time = 86400
elif (comp_glc == 'dglc'):
glc_coupling_time = coupling_times["glc_cpl_dt"]
stop_option = case.get_value('STOP_OPTION')
stop_n = case.get_value('STOP_N')
if stop_option == 'nyears':
glc_coupling_time = coupling_times["atm_cpl_dt"]
elif stop_option == 'nsteps':
glc_coupling_time = stop_n * coupling_times["atm_cpl_dt"]
elif stop_option == 'ndays':
glc_coupling_time = stop_n * 86400
else:
glc_coupling_time = 86400
elif (comp_glc == 'xglc'):
glc_coupling_time = coupling_times["glc_cpl_dt"]
else:
Expand Down
61 changes: 59 additions & 2 deletions mediator/esmFldsExchange_cesm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if

! ---------------------------------------------------------------------
! to atm: unmerged ugust_out from ocn
! to atm: unmerged ugust_out from ocn
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_aoflux('So_ugustOut')
Expand All @@ -1386,7 +1386,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if

! ---------------------------------------------------------------------
! to atm: 10 m winds including/excluding gust component
! to atm: 10 m winds including/excluding gust component
! ---------------------------------------------------------------------
if (phase == 'advertise') then
call addfld_aoflux('So_u10withGust')
Expand Down Expand Up @@ -2317,6 +2317,30 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if
end if

!-----------------------------
! from wav: for daily averaged fields for
! output to auxiliary file only
!-----------------------------
if (phase == 'advertise') then
call addfld_from(compwav, 'Sw_ustokes_avg')
call addfld_from(compwav, 'Sw_vstokes_avg')
call addfld_from(compwav, 'Sw_hs_avg')
call addfld_from(compwav, 'Sw_phs0_avg')
call addfld_from(compwav, 'Sw_phs1_avg')
call addfld_from(compwav, 'Sw_pdir0_avg')
call addfld_from(compwav, 'Sw_pdir1_avg')
call addfld_from(compwav, 'Sw_pTm10_avg')
call addfld_from(compwav, 'Sw_pTm11_avg')
call addfld_from(compwav, 'Sw_Tm1_avg')
call addfld_from(compwav, 'Sw_thm_avg')
call addfld_from(compwav, 'Sw_thp0_avg')
call addfld_from(compwav, 'Sw_fp0_avg')
call addfld_from(compwav, 'Sw_u_avg')
call addfld_from(compwav, 'Sw_v_avg')
call addfld_from(compwav, 'Sw_tusx_avg')
call addfld_from(compwav, 'Sw_tusy_avg')
end if

!-----------------------------
! to ocn: Langmuir multiplier from wave
!-----------------------------
Expand Down Expand Up @@ -3008,22 +3032,36 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
if (phase == 'advertise') then
call addfld_from(compatm, 'Sa_u')
call addfld_to(compwav, 'Sa_u')
call addfld_from(compatm, 'Sa_u10m')
call addfld_to(compwav, 'Sa_u10m')
else
if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_u', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_u', rc=rc)) then
call addmap_from(compatm, 'Sa_u', compwav, mapbilnr, 'one', atm2wav_map)
call addmrg_to(compwav, 'Sa_u', mrg_from=compatm, mrg_fld='Sa_u', mrg_type='copy')
end if
if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_u10m', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_u10m', rc=rc)) then
call addmap_from(compatm, 'Sa_u10m', compwav, mapbilnr, 'one', atm2wav_map)
call addmrg_to(compwav, 'Sa_u10m', mrg_from=compatm, mrg_fld='Sa_u10m', mrg_type='copy')
end if
end if
if (phase == 'advertise') then
call addfld_from(compatm, 'Sa_v')
call addfld_to(compwav, 'Sa_v')
call addfld_from(compatm, 'Sa_v10m')
call addfld_to(compwav, 'Sa_v10m')
else
if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_v', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_v', rc=rc)) then
call addmap_from(compatm, 'Sa_v', compwav, mapbilnr, 'one', atm2wav_map)
call addmrg_to(compwav, 'Sa_v', mrg_from=compatm, mrg_fld='Sa_v', mrg_type='copy')
end if
if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_v10m', rc=rc) .and. &
fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_v10m', rc=rc)) then
call addmap_from(compatm, 'Sa_v10m', compwav, mapbilnr, 'one', atm2wav_map)
call addmrg_to(compwav, 'Sa_v10m', mrg_from=compatm, mrg_fld='Sa_v10m', mrg_type='copy')
end if
end if

! ---------------------------------------------------------------------
Expand Down Expand Up @@ -3342,6 +3380,25 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
end if
endif

!=====================================================================
! DMS EXCHANGE
!=====================================================================

! Get dms flux from ocn and send to atm
if (phase == 'advertise') then
call addfld_from(compocn, 'Faoo_dms_ocn')
call addfld_to(compatm, 'Faoo_dms_ocn')
else
! Note that Faoo_dmds should not be weighted by ifrac - since
! it will be weighted by ifrac in the merge to the atm
if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_dms_ocn', rc=rc) .and. &
fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_dms_ocn', rc=rc)) then
call addmap_from(complnd, 'Faoo_dms_ocn', compocn, mapconsf, 'lfrac', ocn2atm_map)
call addmrg_to(compatm , 'Faoo_dms_ocn', &
mrg_from=compmed, mrg_fld='Faoo_dms_ocn', mrg_type='merge', mrg_fracname='ofrac')
end if
end if

end subroutine esmFldsExchange_cesm

end module esmFldsExchange_cesm_mod
84 changes: 84 additions & 0 deletions mediator/fd_cesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@
canonical_units: m s-1
description: atmosphere export - bottom layer meridional wind
#
- standard_name: Sa_u10m
canonical_units: m s-1
description: atmosphere export - 10m zonal wind
#
- standard_name: Sa_v10m
canonical_units: m s-1
description: atmosphere export- 10m meridional wind
#
- standard_name: Sa_wspd
alias: inst_wind_speed_height_lowest
canonical_units: m s-1
Expand Down Expand Up @@ -1187,6 +1195,74 @@
alias: wave_elevation_spectrum
canonical_units: m2/s
description: wave elevation spectrum
#
- standard_name: Sw_ustokes_avg
canonical_units: m/s
description: Daily averaged stokes drift u component (only needed for mediator history output)
#
- standard_name: Sw_vstokes_avg
canonical_units: m/s
description: Daily averaged stokes drift v component (only needed for mediator history output)
#
- standard_name: Sw_hs_avg
canonical_units: m
description: Daily averaged significant wave hight (only needed for mediator history output)
#
- standard_name: Sw_phs0_avg
canonical_units: m
description: Daily averaged averaged wind sea swh (only needed for mediator history output)
#
- standard_name: Sw_phs1_avg
canonical_units: m
description: Daily averaged swell swh (only needed for mediator history output)
#
- standard_name: Sw_pdir0_avg
canonical_units: degrees
description: Daily averaged wind sea swh (only needed for mediator history output)
#
- standard_name: Sw_pdir1_avg
canonical_units: degrees
description: Daily averaged swell swh (only needed for mediator history output)
#
- standard_name: Sw_pTm10_avg
canonical_units: s
description: Daily averaged wind sea mean wave Tm1 period (only needed for mediator history output)
#
- standard_name: Sw_pTm11_avg
canonical_units: s
description: Daily average swell mean wave Tm1 period (only needed for mediator history output)
#
- standard_name: Sw_Tm1_avg
canonical_units: s
description: Daily averaged mean wave period of the first moment (only needed for mediator history output)
#
- standard_name: Sw_thm_avg
canonical_units: degrees
description: Daily averaged mean wave direction (only needed for mediator history output)
#
- standard_name: Sw_thp0_avg
canonical_units: degrees
description: Daily averaged peak wave direction (only needed for mediator history output)
#
- standard_name: Sw_fp0_avg
canonical_units: 1/s
description: Daily averaged peak wave frequency (only needed for mediator history output)
#
- standard_name: Sw_u_avg
canonical_units: m/s
description: Daily averaged surface wind zonal (only needed for mediator history output)
#
- standard_name: Sw_v_avg
canonical_units: m/s
description: Daily averaged surface wind meridional (only needed for mediator history output)
#
- standard_name: Sw_tusx_avg
canonical_units: m2/s
description: Daily averaged stokes zonal transport vector (only needed for mediator history output)
#
- standard_name: Sw_tusy_avg
canonical_units: m2/s
description: Daily averaged stokes meridional transport vector (only needed for mediator history output)

#
#-----------------------------------
Expand Down Expand Up @@ -1215,3 +1291,11 @@
#
- standard_name: mask
canonical_units: 1

#-----------------------------------
# section: dms exchange
#-----------------------------------
#
- standard_name: Faoo_dms_ocn
canonical_units: moles m-2 s-1
description: Surface flux of DMS from ocn to atm (downward positive)

0 comments on commit c223a3c

Please sign in to comment.