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

always obtain ndep from datm or cam using cmeps/cdeps #410

Merged
merged 8 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cesm/mod_cesm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ subroutine getfrc_cesm
call ncdefvar('atmbrf_da', 'x y', ndouble, 8)
call ncdefvar('atmn2o_da', 'x y', ndouble, 8)
call ncdefvar('atmnh3_da', 'x y', ndouble, 8)
call ncdefvar('atmnoydep_da', 'x y', ndouble, 8)
call ncdefvar('atmnhxdep_da', 'x y', ndouble, 8)
call ncdefvar('atmnoydep_da', 'x y', ndouble, 8)
call ncdefvar('ztx_da', 'x y', ndouble, 8)
call ncdefvar('mty_da', 'x y', ndouble, 8)
Expand Down Expand Up @@ -301,8 +301,6 @@ subroutine getfrc_cesm
call ncwrtr('mty_da', 'x y', mty_da(1 - nbdy, 1 - nbdy, l2ci), &
iv, 1, 1._r8, 0._r8, 8)
call ncfcls
call xcstop('(getfrc_cesm)')
stop '(getfrc_cesm)'
end if

if (csdiag) then
Expand Down
3 changes: 0 additions & 3 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ def buildcpp(case):
if pio_typename == "pnetcdf":
blom_cppdefs = blom_cppdefs + " -DPNETCDF"

if ocn_grid in ["tnx2v1", "tnx1.5v1", "tnx1v1", "tnx1v3", "tnx1v4", "tnx0.5v1", "tnx0.25v1", "tnx0.25v3", "tnx0.25v4", "tnx0.125v4"]:
blom_cppdefs = blom_cppdefs + " -DARCTIC"

if ocn_grid in ["gx1v5", "gx1v6", "tnx1v1", "tnx1v3", "tnx1v4", "tnx0.5v1", "tnx0.25v1", "tnx0.25v3", "tnx0.25v4", "tnx0.125v4"]:
blom_cppdefs = blom_cppdefs + " -DLEVITUS2X"

Expand Down
60 changes: 48 additions & 12 deletions cime_config/namelist_definition_blom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -636,17 +636,6 @@
</desc>
</entry>

<entry id="use_stream_relaxation">
<type>logical</type>
<category>limits</category>
<group>limits</group>
<values>
<value>.false.</value>
<value comp_interface="nuopc">.true.</value>
</values>
<desc>if .true., use NUOPC stream relaxation capability</desc>
</entry>

<entry id="trxday">
<type>real</type>
<category>limits</category>
Expand Down Expand Up @@ -903,6 +892,26 @@
<desc>0 = netcdf, 1 = pnetcdf</desc>
</entry>

<entry id="use_diag">
<type>logical</type>
<category>limits</category>
<group>limits</group>
<values>
<value>.false.</value>
</values>
<desc>optionally turn on additional diagnostics</desc>
</entry>

<entry id="use_arctic">
<type>logical</type>
<category>limits</category>
<group>limits</group>
<values>
<value>.true.</value>
</values>
<desc>if region includes arctic ocean</desc>
</entry>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Question out of curiosity: what is the use_arctic switch for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

use_arctic has a different communication pattern in mod_xc.F90.
In particular - it checks that all arctic patch tiles must be the same size or empty,
and empty tiles must be "twinned" across the top boundary. It ensures that the latitudinal tile dimension is closed/arctic and handles the halo in the arctic differently. @matsbn - do you want to add more?

<!-- ========================= -->
<!-- namelist group: vcoord -->
<!-- ========================= -->
Expand Down Expand Up @@ -3830,6 +3839,18 @@
<desc>File name (incl. full path) for atmopheric N-deposition data</desc>
</entry>

<entry id="use_nuopc_ndep">
<type>logical</type>
<category>config_bgc</category>
<group>config_bgc</group>
<values>
<value>.false.</value>
<value comp_interface="nuopc">.true.</value>
</values>
<desc>if .true., use NUOPC to obtain NDEP (always imported to model) and ignore the
settings of do_ndep_coupled and ndepfile, whereas the setting of do_ndep is still used</desc>
</entry>

<entry id="do_ndep_coupled" modify_via_xml="HAMOCC_ATMNDEPC">
<type>logical</type>
<category>bgcnml</category>
Expand Down Expand Up @@ -6051,7 +6072,7 @@
<value is_test="yes">0,0,0</value>
<value is_test="yes" empty_hist="yes">0,0,0</value>
</values>
<desc>AMELIST FOR DIAGNOSTIC iHAMOCC OUTPUT</desc>
<desc>namelist for diagnostic iHAMOCC output</desc>
</entry>

<entry id="flx_car0100">
Expand Down Expand Up @@ -8738,6 +8759,21 @@
<desc>(ssster) [mol m-3]</desc>
</entry>

<!-- ========================= -->
<!-- namelist group: forcing fields using nuopc -->
<!-- ========================= -->

<entry id="use_stream_relaxation">
<type>logical</type>
<category>limits</category>
<group>limits</group>
<values>
<value>.false.</value>
<value comp_interface="nuopc">.true.</value>
</values>
<desc>if .true., use NUOPC stream relaxation capability</desc>
</entry>

<!-- ========================= -->
<!-- namelist group: stream_sss -->
<!-- ========================= -->
Expand Down
11 changes: 11 additions & 0 deletions drivers/nuopc/ocn_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module ocn_import_export
rnf_da, rfi_da, fmltfz_da, sfl_da, ztx_da, mty_da, &
ustarw_da, slp_da, abswnd_da, ficem_da, lamult_da, &
lasl_da, ustokes_da, vstokes_da, atmco2_da, &
atmnhxdep_da, atmnoydep_da, &
l1ci, l2ci
use mod_utility, only: util1, util2
use mod_checksum, only: csdiag, chksummsk
Expand Down Expand Up @@ -142,6 +143,7 @@ module ocn_import_export
index_Faxa_lwdn = -1, &
index_Faxa_snow = -1, &
index_Faxa_rain = -1, &
index_Faxa_ndep = -1, &
index_Sa_pslv = -1, &
index_Sa_co2diag = -1, &
index_Sa_co2prog = -1, &
Expand Down Expand Up @@ -269,6 +271,8 @@ subroutine blom_advertise_imports(flds_scalar_name, fldsToOcn_num, fldsToOcn, &
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_lwdn' , index_Faxa_lwdn)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_snow' , index_Faxa_snow)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_rain' , index_Faxa_rain)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_ndep' , index_Faxa_ndep, &
ungridded_lbound=1, ungridded_ubound=2)
if (flds_co2a .or. flds_co2c) then
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sa_co2diag' ,index_Sa_co2diag)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sa_co2prog', index_Sa_co2prog)
Expand Down Expand Up @@ -884,6 +888,9 @@ subroutine blom_importflds(fldlist_num, fldlist)
! Ice fraction [].
ficem_da(i,j,l2ci) = fldlist(index_Si_ifrac)%dataptr(n)

! Nitrogen deposition [kg m-2 s-1].
atmnhxdep_da(i,j,l2ci) = fldlist(index_Faxa_ndep)%dataptr2d(1,n)*afac
atmnoydep_da(i,j,l2ci) = fldlist(index_Faxa_ndep)%dataptr2d(2,n)*afac
endif

enddo
Expand All @@ -901,6 +908,8 @@ subroutine blom_importflds(fldlist_num, fldlist)
call xctilr(swa_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(nsf_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(hmlt_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(atmnhxdep_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(atmnoydep_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
endif

call fill_global(mval, fval, halo_ps, slp_da(1-nbdy,1-nbdy,l2ci))
Expand Down Expand Up @@ -1034,6 +1043,8 @@ subroutine blom_importflds(fldlist_num, fldlist)
call chksummsk(abswnd_da(1-nbdy,1-nbdy,l2ci),ip,1,'abswnd')
call chksummsk( ficem_da(1-nbdy,1-nbdy,l2ci),ip,1,'ficem')
call chksummsk(atmco2_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmco2')
call chksummsk(atmnhxdep_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmnhxdep')
call chksummsk(atmnoydep_da(1-nbdy,1-nbdy,l2ci),ip,1,'atmnoydep')
endif

if (first_call) then
Expand Down
1 change: 1 addition & 0 deletions hamocc/mo_control_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module mo_control_bgc
logical :: use_BOXATM = .false.
logical :: use_sedbypass = .false.
logical :: use_extNcycle = .false.
logical :: use_nuopc_ndep = .false.
logical :: use_pref_tracers = .true.

contains
Expand Down
7 changes: 5 additions & 2 deletions hamocc/mo_hamocc_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
dtb,dtbgc,io_stdo_bgc,ldtbgc, &
ldtrunbgc,ndtdaybgc,with_dmsph,l_3Dvarsedpor,use_M4AGO, &
do_ndep_coupled,lkwrbioz_off,do_n2onh3_coupled, &
ocn_co2_type, use_sedbypass, use_BOXATM, use_BROMO,use_extNcycle
ocn_co2_type, use_sedbypass, use_BOXATM, use_BROMO,use_extNcycle, &
use_nuopc_ndep
use mo_param1_bgc, only: ks,init_por2octra_mapping
use mo_param_bgc, only: ini_parambgc
use mo_carbch, only: alloc_mem_carbch,ocetra,atm,atm_co2
Expand Down Expand Up @@ -198,7 +199,9 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
! --- Initialise reading of input data (dust, n-deposition, river, etc.)
!
call ini_read_fedep(idm,jdm,omask)
call ini_read_ndep(idm,jdm)
if (.not. use_nuopc_ndep) then
call ini_read_ndep(idm,jdm)
end if
call ini_read_rivin(idm,jdm,omask)
call ini_read_oafx(idm,jdm,bgc_dx,bgc_dy,plat,omask)
if (use_BROMO) then
Expand Down
4 changes: 2 additions & 2 deletions hamocc/mo_param1_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ subroutine init_indices()
use mo_control_bgc, only: bgc_namelist,get_bgc_namelist, io_stdo_bgc
use mo_control_bgc, only: use_BROMO,use_AGG,use_WLIN,use_natDIC,use_CFC,use_cisonew, &
use_sedbypass,use_PBGC_OCNP_TIMESTEP,use_PBGC_CK_TIMESTEP, &
use_FB_BGC_OCE, use_BOXATM,use_extNcycle,use_pref_tracers
use_FB_BGC_OCE, use_BOXATM,use_extNcycle,use_pref_tracers,use_nuopc_ndep
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a line break here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

integer :: iounit

namelist / config_bgc / use_BROMO,use_AGG,use_WLIN,use_natDIC,use_CFC,use_cisonew, &
use_sedbypass,use_PBGC_OCNP_TIMESTEP,use_PBGC_CK_TIMESTEP, &
use_FB_BGC_OCE,use_BOXATM,use_extNcycle,use_pref_tracers
use_FB_BGC_OCE,use_BOXATM,use_extNcycle,use_pref_tracers,use_nuopc_ndep

io_stdo_bgc = lp ! standard out.

Expand Down
Loading