@@ -75,6 +75,10 @@ module esmFldsExchange_cesm_mod
75
75
character (len= CX) :: rof2lnd_map = ' unset'
76
76
character (len= CX) :: lnd2rof_map = ' unset'
77
77
78
+ ! optional mapping files
79
+ character (len= CX) :: wav2ocn_map = ' unset'
80
+ character (len= CX) :: ocn2wav_map = ' unset'
81
+
78
82
! no mapping files (value is 'idmap' or 'unset')
79
83
character (len= CX) :: atm2ice_map = ' unset'
80
84
character (len= CX) :: atm2ocn_map = ' unset'
@@ -84,9 +88,7 @@ module esmFldsExchange_cesm_mod
84
88
character (len= CX) :: ice2wav_map = ' unset'
85
89
character (len= CX) :: lnd2atm_map = ' unset'
86
90
character (len= CX) :: ocn2atm_map = ' unset'
87
- character (len= CX) :: ocn2wav_map = ' unset'
88
91
character (len= CX) :: rof2ocn_map = ' unset'
89
- character (len= CX) :: wav2ocn_map = ' unset'
90
92
91
93
logical :: mapuv_with_cart3d ! Map U/V vector wind fields from ATM to OCN/ICE by rotating in Cartesian 3D space and then back
92
94
logical :: flds_i2o_per_cat ! Ice thickness category fields passed to OCN
@@ -95,6 +97,7 @@ module esmFldsExchange_cesm_mod
95
97
logical :: flds_co2c ! Pass CO2 from ATM to surface (OCN/LND) and back from them to ATM
96
98
logical :: flds_wiso ! Pass water isotop fields
97
99
logical :: flds_r2l_stream_channel_depths ! Pass channel depths from ROF to LND
100
+ logical :: add_gusts ! Whether to include fields related to the gustiness parameterization
98
101
99
102
character (* ), parameter :: u_FILE_u = &
100
103
__FILE__
@@ -202,6 +205,14 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
202
205
if (chkerr(rc,__LINE__,u_FILE_u)) return
203
206
if (maintask) write (logunit, ' (a)' ) trim (subname)// ' rof2ocn_ice_rmapname = ' // trim (rof2ocn_ice_rmap)
204
207
208
+ call NUOPC_CompAttributeGet(gcomp, name= ' wav2ocn_smapname' , value= wav2ocn_map, rc= rc)
209
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
210
+ if (maintask) write (logunit, ' (a)' ) trim (subname)// ' wav2ocn_smapname = ' // trim (wav2ocn_map)
211
+ call NUOPC_CompAttributeGet(gcomp, name= ' ocn2wav_smapname' , value= ocn2wav_map, rc= rc)
212
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
213
+ if (maintask) write (logunit, ' (a)' ) trim (subname)// ' ocn2wav_smapname = ' // trim (ocn2wav_map)
214
+
215
+
205
216
! uv cart3d mapping
206
217
call NUOPC_CompAttributeGet(gcomp, name= ' mapuv_with_cart3d' , value= cvalue, rc= rc)
207
218
if (chkerr(rc,__LINE__,u_FILE_u)) return
@@ -232,6 +243,11 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
232
243
if (ChkErr(rc,__LINE__,u_FILE_u)) return
233
244
read (cvalue,* ) flds_r2l_stream_channel_depths
234
245
246
+ ! are fields related to the gustiness parameterization enabled?
247
+ call NUOPC_CompAttributeGet(gcomp, name= ' add_gusts' , value= cvalue, rc= rc)
248
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
249
+ read (cvalue,* ) add_gusts
250
+
235
251
! write diagnostic output
236
252
if (maintask) then
237
253
write (logunit,' (a)' ) ' flds_co2a: prognostic and diagnostic CO2 at lowest atm level is sent to lnd and ocn'
@@ -246,6 +262,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
246
262
write (logunit,' (a,l7)' ) trim (subname)// ' flds_wiso = ' ,flds_wiso
247
263
write (logunit,' (a,l7)' ) trim (subname)// ' flds_i2o_per_cat = ' ,flds_i2o_per_cat
248
264
write (logunit,' (a,l7)' ) trim (subname)// ' flds_r2l_stream_channel_depths = ' ,flds_r2l_stream_channel_depths
265
+ write (logunit,' (a,l7)' ) trim (subname)// ' add_gusts = ' , add_gusts
249
266
write (logunit,' (a,l7)' ) trim (subname)// ' mapuv_with_cart3d = ' ,mapuv_with_cart3d
250
267
end if
251
268
@@ -1414,35 +1431,39 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
1414
1431
! ---------------------------------------------------------------------
1415
1432
! to atm: unmerged ugust_out from ocn
1416
1433
! ---------------------------------------------------------------------
1417
- if (phase == ' advertise' ) then
1418
- call addfld_aoflux(' So_ugustOut' )
1419
- call addfld_to(compatm, ' So_ugustOut' )
1420
- else
1421
- if ( fldchk(is_local% wrap% FBexp(compatm), ' So_ugustOut' , rc= rc)) then
1422
- if (fldchk(is_local% wrap% FBMed_aoflux_o, ' So_ugustOut' , rc= rc)) then
1423
- if (trim (is_local% wrap% aoflux_grid) == ' ogrid' ) then
1424
- call addmap_aoflux(' So_ugustOut' , compatm, mapconsf, ' ofrac' , ocn2atm_map)
1434
+ if (add_gusts) then
1435
+ if (phase == ' advertise' ) then
1436
+ call addfld_aoflux(' So_ugustOut' )
1437
+ call addfld_to(compatm, ' So_ugustOut' )
1438
+ else
1439
+ if ( fldchk(is_local% wrap% FBexp(compatm), ' So_ugustOut' , rc= rc)) then
1440
+ if (fldchk(is_local% wrap% FBMed_aoflux_o, ' So_ugustOut' , rc= rc)) then
1441
+ if (trim (is_local% wrap% aoflux_grid) == ' ogrid' ) then
1442
+ call addmap_aoflux(' So_ugustOut' , compatm, mapconsf, ' ofrac' , ocn2atm_map)
1443
+ end if
1444
+ call addmrg_to(compatm , ' So_ugustOut' , &
1445
+ mrg_from= compmed, mrg_fld= ' So_ugustOut' , mrg_type= ' merge' , mrg_fracname= ' ofrac' )
1425
1446
end if
1426
- call addmrg_to(compatm , ' So_ugustOut' , &
1427
- mrg_from= compmed, mrg_fld= ' So_ugustOut' , mrg_type= ' merge' , mrg_fracname= ' ofrac' )
1428
1447
end if
1429
1448
end if
1430
1449
end if
1431
1450
1432
1451
! ---------------------------------------------------------------------
1433
1452
! to atm: 10 m winds including/excluding gust component
1434
1453
! ---------------------------------------------------------------------
1435
- if (phase == ' advertise' ) then
1436
- call addfld_aoflux(' So_u10withGust' )
1437
- call addfld_to(compatm, ' So_u10withGust' )
1438
- else
1439
- if ( fldchk(is_local% wrap% FBexp(compatm), ' So_u10withGust' , rc= rc)) then
1440
- if (fldchk(is_local% wrap% FBMed_aoflux_o, ' So_u10withGust' , rc= rc)) then
1441
- if (trim (is_local% wrap% aoflux_grid) == ' ogrid' ) then
1442
- call addmap_aoflux(' So_u10withGust' , compatm, mapconsf, ' ofrac' , ocn2atm_map)
1454
+ if (add_gusts) then
1455
+ if (phase == ' advertise' ) then
1456
+ call addfld_aoflux(' So_u10withGust' )
1457
+ call addfld_to(compatm, ' So_u10withGust' )
1458
+ else
1459
+ if ( fldchk(is_local% wrap% FBexp(compatm), ' So_u10withGust' , rc= rc)) then
1460
+ if (fldchk(is_local% wrap% FBMed_aoflux_o, ' So_u10withGust' , rc= rc)) then
1461
+ if (trim (is_local% wrap% aoflux_grid) == ' ogrid' ) then
1462
+ call addmap_aoflux(' So_u10withGust' , compatm, mapconsf, ' ofrac' , ocn2atm_map)
1463
+ end if
1464
+ call addmrg_to(compatm , ' So_u10withGust' , &
1465
+ mrg_from= compmed, mrg_fld= ' So_u10withGust' , mrg_type= ' merge' , mrg_fracname= ' ofrac' )
1443
1466
end if
1444
- call addmrg_to(compatm , ' So_u10withGust' , &
1445
- mrg_from= compmed, mrg_fld= ' So_u10withGust' , mrg_type= ' merge' , mrg_fracname= ' ofrac' )
1446
1467
end if
1447
1468
end if
1448
1469
end if
@@ -1700,7 +1721,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
1700
1721
else
1701
1722
if ( fldchk(is_local% wrap% FBImp(compocn,compocn), ' Faoo_fdms_ocn' , rc= rc) .and. &
1702
1723
fldchk(is_local% wrap% FBexp(compatm) , ' Faoo_fdms_ocn' , rc= rc)) then
1703
- call addmap_from(compocn, ' Faoo_fdms_ocn' , compocn , mapconsd, ' one' , ocn2atm_map)
1724
+ call addmap_from(compocn, ' Faoo_fdms_ocn' , compatm , mapconsd, ' one' , ocn2atm_map)
1704
1725
! custom merge in med_phases_prep_atm
1705
1726
end if
1706
1727
end if
@@ -1714,7 +1735,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
1714
1735
else
1715
1736
if ( fldchk(is_local% wrap% FBImp(compocn,compocn), ' Faoo_fbrf_ocn' , rc= rc) .and. &
1716
1737
fldchk(is_local% wrap% FBexp(compatm) , ' Faoo_fbrf_ocn' , rc= rc)) then
1717
- call addmap_from(compocn, ' Faoo_fbrf_ocn' , compocn , mapconsd, ' one' , ocn2atm_map)
1738
+ call addmap_from(compocn, ' Faoo_fbrf_ocn' , compatm , mapconsd, ' one' , ocn2atm_map)
1718
1739
! custom merge in med_phases_prep_atm
1719
1740
end if
1720
1741
end if
@@ -1728,7 +1749,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
1728
1749
else
1729
1750
if ( fldchk(is_local% wrap% FBImp(compocn,compocn), ' Faoo_fn2o_ocn' , rc= rc) .and. &
1730
1751
fldchk(is_local% wrap% FBexp(compatm) , ' Faoo_fn2o_ocn' , rc= rc)) then
1731
- call addmap_from(compocn, ' Faoo_fn2o_ocn' , compocn , mapconsd, ' one' , ocn2atm_map)
1752
+ call addmap_from(compocn, ' Faoo_fn2o_ocn' , compatm , mapconsd, ' one' , ocn2atm_map)
1732
1753
! custom merge in med_phases_prep_atm
1733
1754
end if
1734
1755
end if
@@ -1742,7 +1763,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
1742
1763
else
1743
1764
if ( fldchk(is_local% wrap% FBImp(compocn,compocn), ' Faoo_fnh3_ocn' , rc= rc) .and. &
1744
1765
fldchk(is_local% wrap% FBexp(compatm) , ' Faoo_fnh3_ocn' , rc= rc)) then
1745
- call addmap_from(compocn, ' Faoo_fnh3_ocn' , compocn , mapconsd, ' one' , ocn2atm_map)
1766
+ call addmap_from(compocn, ' Faoo_fnh3_ocn' , compatm , mapconsd, ' one' , ocn2atm_map)
1746
1767
! custom merge in med_phases_prep_atm
1747
1768
end if
1748
1769
end if
0 commit comments