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

Sync w/ ESCOMP, add cpl_scalars for CSG and regional ATM domains #115

Merged
merged 561 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
561 commits
Select commit Hold shift + click to select a range
c2f8792
fix issues in merge
jedwards4b Jan 25, 2023
efa1e47
Merge pull request #325 from jedwards4b/pio_asyncio_in_cmeps
jedwards4b Jan 26, 2023
89e4ba6
changes needed for CDEP PR #213
Jan 30, 2023
70d6913
added new auxiliary stream for ocn2med
Jan 31, 2023
a0178b2
fix the multi instance initialization
jedwards4b Feb 1, 2023
96f1b73
Merge pull request #342 from jedwards4b/fix_multiinst_init
jedwards4b Feb 1, 2023
cb36640
Merge pull request #341 from mvertens/feature/cplhist_and_ocnimport
jedwards4b Feb 1, 2023
3a218b8
make xgrid default, handle main task for multidriver cases in esm_tim…
jedwards4b Feb 3, 2023
24522e3
changes for lightning coupling
fvitt Jun 24, 2022
62c15cd
Changed "atm_lightning_flash_freq" to "atm_provides_lightning"
fvitt Jul 13, 2022
6712c8c
rename Sa_lght as Sa_lightning
fvitt Jul 22, 2022
c8ed018
update to cmeps0.14.10
fvitt Feb 3, 2023
21074d9
Merge pull request #343 from jedwards4b/xgrid_and_maintask
jedwards4b Feb 3, 2023
895e623
Revert default aoflux_grid to ogrid
billsacks Mar 16, 2023
24ac1ba
Merge pull request #344 from billsacks/revert_xgrid
jedwards4b Mar 16, 2023
7ff0d3b
Remove unnecessary deallocate
billsacks Mar 22, 2023
97a4fe1
Merge pull request #345 from billsacks/remove_unnecessary_deallocate
jedwards4b Mar 22, 2023
18e5075
Add Jim's changes for new GPU options based on his branch: https://gi…
sjsprecious Mar 23, 2023
ebb0818
Add MAX_CPUTASKS_PER_GPU_NODE XML variable
sjsprecious Mar 23, 2023
72c1230
Remove default_values and valid_values for GPU_TYPE and GPU_OFFLOAD
sjsprecious Mar 24, 2023
195b86b
Merge remote-tracking branch 'origin/lightning_coupling' into cmeps0.…
fvitt Mar 27, 2023
5bb31fe
Send nitrogen deposition from atm to ocn
mnlevy1981 Mar 28, 2023
6cfd189
Clean up comments
mnlevy1981 Mar 28, 2023
5476eaa
A fix for #346 so that LND2ROF_FMAPNAME will be used
ekluzek Mar 29, 2023
c3e8e23
replace aux_cam with aux_cmeps in testlist
jedwards4b Apr 5, 2023
f191f85
Merge pull request #358 from jedwards4b/aux_cam-to-aux_cmeps
jedwards4b Apr 5, 2023
805d252
using copy_with_weights causes weights to be applied twice
jedwards4b Apr 5, 2023
b31366f
Merge pull request #349 from mnlevy1981/send_ndep_to_ocn
jedwards4b Apr 6, 2023
d8ddff5
Merge pull request #356 from mattldawson/develop-add-linked-libs
jedwards4b Apr 6, 2023
ac4d591
use updated error check and broadcast methods
fvitt Apr 7, 2023
4cf3e05
Added Fwxx_taux and Fwxx_tauy, based on Foxx_taux and Foxx_tauy
phall-brown Apr 12, 2023
e68d9bc
Trying simpler form of sharing Foxx to compwav
phall-brown Apr 14, 2023
eb18694
Turning off Foxx export to waves for testing
phall-brown Apr 14, 2023
22dbf82
Merge pull request #361 from ekluzek/lndrofmapfilefix
jedwards4b Apr 17, 2023
8cccca6
Merge branch 'main' into add_gpu_gust
sjsprecious Apr 17, 2023
c791efc
Adding Fwxx_taux to get wind stress to pass to wave model
phall-brown Apr 17, 2023
8db2449
Adding Fwxx_taux, using Foxx_taux as a model
phall-brown Apr 17, 2023
a599c2f
Comment out unnecessary line
phall-brown Apr 17, 2023
61cf378
fix issue with xgrid reproducibility
jedwards4b Apr 19, 2023
26f997c
Merge pull request #364 from jedwards4b/xgrid_reproducability_fix
jedwards4b Apr 19, 2023
f126b9f
update the minimum esmf version requirement
jedwards4b Apr 19, 2023
b4c3d9d
Merge pull request #347 from fvitt/cmeps0.14.18_lightning_coupling
jedwards4b Apr 20, 2023
263bebe
added wav/ice coupling
mvertens Apr 25, 2023
e50d27d
merged to cmeps0.14.24
mvertens Apr 25, 2023
17fa9d5
Adding custom field subroutine for waves with cesm, based on equivale…
phall-brown Apr 25, 2023
5712122
Passing So_ofrac to wav component
phall-brown Apr 25, 2023
e6451a4
Changing merge to Fwxx_taux to copy
phall-brown Apr 25, 2023
bdd726a
Fixed syntax of addmrg_to call for Fwxx_taux
phall-brown Apr 25, 2023
dec4bfb
Reverted earlier modifications
phall-brown Apr 25, 2023
d4b8441
Substituting Foxx_taux for Faox_taux
phall-brown Apr 25, 2023
d666f83
Revert "Substituting Foxx_taux for Faox_taux"
phall-brown Apr 26, 2023
3925710
Removed export of So_ofrac to wav component (unnecessary), and other …
phall-brown Apr 26, 2023
e142b2d
Cleaning up earlier, temporary code
phall-brown Apr 26, 2023
14bd205
Removed unnecessary fldList variable
phall-brown Apr 26, 2023
0bab18a
Merge pull request #1 from mvertens/feature/fix_wavice_coupling
mvertens Apr 26, 2023
abc5658
Adding stress from ice to Fwxx_taux
phall-brown Apr 26, 2023
cb585c5
Removed mrg_fracname from Fwxx merges
phall-brown Apr 26, 2023
95c5188
Added ifrac and ofrac to FBFrac for wave component
phall-brown Apr 26, 2023
5633ff2
Using ifrac and ofrac weights for Fbww merge
phall-brown Apr 26, 2023
a3c13d2
Updated comments to include wave component
phall-brown Apr 26, 2023
51f7601
updates to remove mct_mod and all other mct related files from share/
mvertens Apr 28, 2023
bcd23e4
Merge pull request #2 from mvertens/feature/remove_mct_from_share
mvertens Apr 28, 2023
962646a
improves the readability of salt budget
jedwards4b Apr 28, 2023
f80e7d7
undo accidental commit
jedwards4b Apr 28, 2023
68baf9f
Added new fractions (ifrac, ofrac) for wave component
phall-brown Apr 28, 2023
04296bd
Added compwav declaration to med_fraction_set subroutine
phall-brown Apr 28, 2023
5bc4403
Corrected two typos where compice was being passed instead of compwav
phall-brown Apr 28, 2023
69317cb
Removing previous additions for wavcomp
phall-brown Apr 29, 2023
baaf12c
Removing stress from compice from Fwxx_taux
phall-brown Apr 29, 2023
24f419c
turn off HierarchyProtocol, not used in cesm this is a memory and ini…
jedwards4b Apr 29, 2023
9c43424
correct comment delimiter
jedwards4b May 1, 2023
fcc45ff
Merge pull request #369 from jedwards4b/Turn_OFF_HierarchyProtocol
jedwards4b May 1, 2023
cf7ec4f
Merge pull request #368 from jedwards4b/improve_diag_salt_format
jedwards4b May 1, 2023
16d7223
removed unused variable
mvertens May 5, 2023
dbfb31a
removed unneeded xml variables
mvertens May 5, 2023
76bba43
Merge pull request #3 from mvertens/feature/remove_uneeded_xmlvars
mvertens May 5, 2023
7bb5053
check for nans
mvertens May 5, 2023
284137f
Merge pull request #376 from NorESMhub/noresm
jedwards4b May 5, 2023
9ee4d83
refactored logic
mvertens May 5, 2023
3ad7f1f
updated med_diag_mod with recent changes from escomp
mvertens May 5, 2023
311582c
This fails to enable writing of 'daily' files from forecasts shorter …
kdraeder May 6, 2023
0d2a0c8
Merge branch 'aux_cpl_hist_daily' of github.com:kdraeder/CMEPS into a…
kdraeder May 6, 2023
83bba42
updated counters for nans
mvertens May 8, 2023
0b59db6
consistent alias of use statements for check_for_nans
mvertens May 8, 2023
64439f7
fixed compilation bug
mvertens May 8, 2023
5e02def
add ability to compile without needed shr_infnan - as is the case for…
mvertens May 8, 2023
6776c24
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 9, 2023
f1dedf5
Changed Fwxx_taux merge to use 'wfrac'
phall-brown May 9, 2023
22b6278
Merge pull request #377 from mvertens/feature/check_for_nans
jedwards4b May 10, 2023
2685626
Adding merge to wave component Fwxx_taux based on Foxx_taux
phall-brown May 10, 2023
9d4e81c
Fixed a compocn that should have been compwav
phall-brown May 10, 2023
3ca2795
Adding ifrac and ofrac to fraclist_w
phall-brown May 10, 2023
7ac3ca9
make history_n integer variables
jedwards4b May 10, 2023
b22ae22
sames should be samples
jedwards4b May 10, 2023
cca94e4
wopen should return rc
jedwards4b May 10, 2023
66c0d0f
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 11, 2023
a936f7e
Merge pull request #365 from jedwards4b/update_esmf_min_version
jedwards4b May 11, 2023
a316646
major refactor of med_io_mod to handle multiple files
jedwards4b May 11, 2023
4490cff
ntperfile should be type integer
jedwards4b May 11, 2023
57e1970
remove unused variable
jedwards4b May 11, 2023
1aab35a
Merge pull request #1 from jedwards4b/history_n
kdraeder May 11, 2023
5d7470d
CESM_COUPLED should be CESMCOUPLED
jedwards4b May 11, 2023
b60c9d7
Candidate fixes of descriptions and comments
kdraeder May 11, 2023
106a99d
Merge pull request #380 from jedwards4b/cesmcoupledfix
jedwards4b May 11, 2023
42a5fd5
remove dead code
jedwards4b May 11, 2023
fd9151a
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 12, 2023
ebc63bb
allow ufs to use check nan feature
DeniseWorthen May 12, 2023
a25075d
fix comments
DeniseWorthen May 12, 2023
96206b6
adjust indentation
jedwards4b May 12, 2023
f2cbf27
Merge pull request #378 from kdraeder/aux_cpl_hist_daily
jedwards4b May 15, 2023
fd9872f
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 15, 2023
a587023
updates for new stresses sent to wave
May 16, 2023
3dbbda3
merged to head of escomp/main
May 16, 2023
ca8ca8b
udpates needed to pass taux and tauxy to wave
May 16, 2023
d64ffe9
fixed compile bugs
May 16, 2023
488b8d9
fixed compile bugs
May 16, 2023
09d1e08
Merge pull request #382 from mvertens/feature/theorywaves
jedwards4b May 17, 2023
f568cfc
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 17, 2023
c3e57f4
make this an input that can be toggled in user_nl_cpl
jedwards4b May 18, 2023
d84c9b3
expand description
jedwards4b May 18, 2023
a753571
make default .true. add log message
jedwards4b May 19, 2023
0ff2afe
resolve circular dependancy
jedwards4b May 19, 2023
689d674
remove CESMCOUPLED cppdef
jedwards4b May 19, 2023
b6ba816
pass the strict ext build test
jedwards4b May 19, 2023
79cf208
rework based on pr review
jedwards4b May 19, 2023
92ace68
fix yaml syntax
jedwards4b May 19, 2023
60b9f19
fix ext versions
jedwards4b May 19, 2023
0b862b9
fix ext versions
jedwards4b May 19, 2023
5b26040
add ispresent and isset
jedwards4b May 23, 2023
dabe6d3
make xgrid default (should have been in alpha12c) and fix sw flux to …
jedwards4b May 23, 2023
e94015a
slight change in logic
jedwards4b May 23, 2023
6a642a6
get ufs to work w/ ocnalb
DeniseWorthen May 24, 2023
f174edd
fix src path for cdeps
jedwards4b May 24, 2023
b7bc64e
Merge pull request #387 from jedwards4b/fix_aoflux_and_swtoocn
jedwards4b May 24, 2023
9817b91
cdeps path again
jedwards4b May 24, 2023
371d752
cdeps path again
jedwards4b May 24, 2023
8f59dba
try building ext with cdeps share
jedwards4b May 24, 2023
06b79ff
Merge pull request #386 from jedwards4b/add_check_for_nans_config_option
jedwards4b May 24, 2023
a34f315
Merge remote-tracking branch 'ESCOMP/main' into feature/updcmeps
DeniseWorthen May 24, 2023
a7a6dcb
testing indicates we are not yet ready for xgrid
jedwards4b May 26, 2023
5ad45de
Merge pull request #388 from jedwards4b/revert_aoflux_to_ogrid
jedwards4b May 26, 2023
d75d75e
remove file accidentally committed
DeniseWorthen May 26, 2023
a4d615e
add config variables for ufs use case
DeniseWorthen May 30, 2023
19042cf
Merge branch 'feature/updcmeps' into feature/fixsw
DeniseWorthen May 31, 2023
b6fd22c
add configuration options for albedo calcs
DeniseWorthen Jun 12, 2023
acbddd2
Merge branch 'emc/develop' into feature/fixsw
DeniseWorthen Jun 14, 2023
5f27114
both =0 is not an error
jedwards4b Jun 23, 2023
98dcf46
Merge pull request #392 from jedwards4b/fixforhighpecnt
jedwards4b Jul 10, 2023
6ef50f3
add surface flux rollover
jedwards4b Jul 24, 2023
5a3bd1c
Merge branch 'NOAA-EMC:emc/develop' into feature/fixsw
DeniseWorthen Jul 25, 2023
7b7d232
remove TODOs
DeniseWorthen Jul 27, 2023
4e09c3a
use log_error, not log_info
DeniseWorthen Jul 27, 2023
9bcf425
remove TODO
DeniseWorthen Jul 27, 2023
0dbe67e
fix the x case
jedwards4b Jul 28, 2023
427ebeb
add missing return error check for FldsExchange
DeniseWorthen Jul 29, 2023
957a0fb
address comments
DeniseWorthen Jul 31, 2023
9b2942a
alternate solution for X case
jedwards4b Jul 31, 2023
3d8e233
update esmf and pio externals used in srt github workflow
jedwards4b Aug 1, 2023
896b6a1
debug workflow
jedwards4b Aug 1, 2023
5945f78
try adding SRCROOT env variable
jedwards4b Aug 1, 2023
8282ebc
remove rof_name
jedwards4b Aug 1, 2023
65770e1
Merge pull request #397 from jedwards4b/xcase_fix
jedwards4b Aug 2, 2023
f5894d4
Merge branch 'main' into feature/fixsw
jedwards4b Aug 4, 2023
6dbea2c
Merge branch 'main' into add_gpu_gust
sjsprecious Aug 7, 2023
ec41c2f
revert changes for swnet in prep_ocn
DeniseWorthen Aug 7, 2023
72ee0b2
Add a new XML variable to apply the MPI wrapper script more generically.
sjsprecious Aug 8, 2023
e951fdc
Merge pull request #363 from sjsprecious/add_gpu_gust
jedwards4b Aug 9, 2023
b751891
Merge pull request #395 from DeniseWorthen/feature/fixsw
jedwards4b Aug 11, 2023
a6071c1
Add length to logic format.
fischer-ncar Aug 21, 2023
abaef5f
Merge pull request #403 from fischer-ncar/logic_length_nag
jedwards4b Aug 21, 2023
ceee88b
Merge branch 'main' into sfcflxrollover
jedwards4b Sep 1, 2023
fd65403
update for se scm
jtruesdal Sep 29, 2023
f168e93
Merge remote-tracking branch 'upstream/emc/develop' into feature/emc_…
DeniseWorthen Oct 7, 2023
31b7da6
Merge pull request #411 from DeniseWorthen/feature/emc_updates
jedwards4b Oct 10, 2023
65aeefb
fix hang on abort issue
jedwards4b Oct 10, 2023
811580f
Merge pull request #394 from jedwards4b/sfcflxrollover
jedwards4b Oct 11, 2023
8038372
Merge pull request #412 from jedwards4b/abort_bugfix
jedwards4b Oct 11, 2023
493a9b9
support for job_priority on derecho
jedwards4b Oct 12, 2023
04e2f6b
Merge pull request #413 from jedwards4b/derecho_priority
jedwards4b Oct 13, 2023
1f0d9e8
remove this unused variable
jedwards4b Oct 23, 2023
d86f405
initial work for inline cdeps
uturuncoglu Oct 25, 2023
5510ad7
more work for cdeps inline
uturuncoglu Oct 27, 2023
6438f3d
more work for inline
uturuncoglu Nov 2, 2023
914957b
Merge pull request #417 from jedwards4b/remove_esmf_logfile_kind
jedwards4b Nov 6, 2023
bcee457
use esmf config file to get stream information
uturuncoglu Nov 7, 2023
96c81b6
more work for inline capability
uturuncoglu Nov 7, 2023
9972d73
Merge remote-tracking branch 'ESCOMP/main' into feature/emc_updates
DeniseWorthen Nov 7, 2023
01bf411
Merge pull request #418 from DeniseWorthen/feature/emc_updates
jedwards4b Nov 7, 2023
794e691
enabling setting source and destination mask for interpolation
uturuncoglu Nov 9, 2023
17b127d
more work for cdeps inline
uturuncoglu Nov 11, 2023
f9ac7af
more work for cmeps and cdeps inline integration
uturuncoglu Nov 12, 2023
b0af4aa
add atm->ocn direction for cdeps inline capability
uturuncoglu Nov 15, 2023
1296a90
activate cdeps inline capability for atm->wav
uturuncoglu Nov 16, 2023
2035266
more changes for derecho
jedwards4b Nov 22, 2023
73ab51a
Merge tag 'cmeps0.14.43' into cmeps0.14.43_scamdev
jtruesdal Nov 26, 2023
a2c16dc
remove the SMP_PRESENT variable and replace with BUILD_THREADED
jedwards4b Dec 14, 2023
778f8c9
Merge pull request #419 from jedwards4b/update_testlist
jedwards4b Dec 15, 2023
ad4d7a3
Merge pull request #421 from jedwards4b/remove_smp_present
jedwards4b Dec 15, 2023
e0731f9
Add modifications to compute gust addition to U10 and control with a …
megandevlan Dec 19, 2023
2df3414
Fix shr_flux comments and cdn calculation
megandevlan Dec 20, 2023
6c321f1
update github tests
jedwards4b Dec 21, 2023
09568f1
fix testing issues
jedwards4b Dec 21, 2023
e96e199
fixing tests
jedwards4b Dec 21, 2023
18c510b
add check for cam_dev if add_gusts is true
jedwards4b Dec 21, 2023
f04687b
add check for cam_dev
jedwards4b Dec 21, 2023
962484b
another reference to gust outside of cesm code
jedwards4b Dec 21, 2023
6d0e37e
debug tests
jedwards4b Dec 21, 2023
3051280
add submodule command
jedwards4b Dec 21, 2023
aaa78b8
add submodule command complication
jedwards4b Dec 21, 2023
b908586
Merge pull request #1 from jedwards4b/gustMods
megandevlan Dec 21, 2023
ce6c935
Merge pull request #422 from megandevlan/gustMods
jedwards4b Dec 21, 2023
46bf811
turn add_gusts on by default for camdev
jedwards4b Dec 21, 2023
d2a08f0
Merge pull request #424 from jedwards4b/gust_on_for_camdev
jedwards4b Dec 22, 2023
40ce110
For T compsets, only run GLC if med_to_glc is true
billsacks Dec 27, 2023
cdb819b
feature to use all data in the first coupling timestep
uturuncoglu Dec 28, 2023
8652157
Merge remote-tracking branch 'upstream/main' into feature/inline
uturuncoglu Dec 29, 2023
d56c50c
fix for gust additions in the aoflux
uturuncoglu Jan 5, 2024
4d08b94
Merge remote-tracking branch 'fork/emc/develop' into feature/inline
uturuncoglu Jan 5, 2024
55c8900
mods for regional mom6 configuration
uturuncoglu Jan 15, 2024
6979bbd
fix for sw bands calculation for cases without sea-ice
uturuncoglu Jan 17, 2024
10e46c3
more work for regional mom6 coupling
uturuncoglu Jan 19, 2024
ad1e9a2
update for hafs.mom6
uturuncoglu Jan 19, 2024
a1cbcbc
switch TOTAL to SELECT for other interpolation types too
uturuncoglu Jan 20, 2024
fb993eb
fix from Denise for crash when diagnose is on by initializing
uturuncoglu Jan 25, 2024
ffb5737
Merge pull request #425 from billsacks/fix_runseq_t_noevolve
jedwards4b Jan 26, 2024
8c10846
fix issue arised in CESM testing
uturuncoglu Jan 27, 2024
ea995f6
Merge remote-tracking branch 'noaa-emc/emc/develop' into feature/inline
uturuncoglu Jan 28, 2024
64e1c27
fix Faxa_rainc issue when add_gusts is turned on
uturuncoglu Jan 29, 2024
09dfd3c
fix comments mean -> inst and minor typo
uturuncoglu Jan 29, 2024
c4f5082
minor fix - remove trim
uturuncoglu Jan 30, 2024
e155c9a
srt does not work with most recent cime, cmeps requires most recent c…
jedwards4b Jan 30, 2024
43953e8
fix srt test
jedwards4b Jan 30, 2024
682a497
fix cime checkout
jedwards4b Jan 30, 2024
87c473c
turn off tmate
jedwards4b Jan 30, 2024
1290140
fix path
jedwards4b Jan 30, 2024
455b2be
debug workflow
jedwards4b Jan 31, 2024
170adbe
give format a length
jedwards4b Jan 31, 2024
7e0908c
Merge pull request #420 from uturuncoglu/feature/inline
jedwards4b Jan 31, 2024
4127636
fix dummy arguments w/o values
DeniseWorthen Jan 31, 2024
fa78b46
Merge branch 'NOAA-EMC:emc/develop' into feature/nowarn
DeniseWorthen Feb 5, 2024
14878f4
add cpl_scalar for tiled grids, other minor fixes
DeniseWorthen Mar 3, 2024
91cc86e
Merge remote-tracking branch 'ESCOMP/main' into feature/cplscalars
DeniseWorthen Mar 3, 2024
f8fb572
Merge remote-tracking branch 'origin/feature/nowarn' into feature/cpl…
DeniseWorthen Mar 3, 2024
3515360
set ntile=0 when ntile scalar doesn't exist
DeniseWorthen Mar 3, 2024
ac5520f
fix restarts when ntile>0
DeniseWorthen Mar 4, 2024
e6dda63
Merge pull request #439 from jtruesdal/cmeps0.14.43_scamdev
jedwards4b Mar 13, 2024
45d63c4
add two fixes
DeniseWorthen Mar 13, 2024
8309884
modify dstmask for lnd->atm in UFS
DeniseWorthen Mar 13, 2024
1825c2b
Merge pull request #436 from DeniseWorthen/feature/cplscalars
jedwards4b Mar 19, 2024
d2e6f99
Merge branch 'NOAA-EMC:emc/develop' into feature/syncescomp
DeniseWorthen Mar 29, 2024
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
49 changes: 35 additions & 14 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1224,13 +1224,17 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
real (r8), allocatable :: lats(:) ! temporary
real (r8), allocatable :: lons(:) ! temporary
real (r8), allocatable :: pos_lons(:) ! temporary
real (r8), allocatable :: pos_lats(:) ! temporary
real (r8), allocatable :: cols(:) ! temporary
real (r8), allocatable :: glob_grid(:,:) ! temporary
real (r8) :: pos_scol_lon ! temporary
real (r8) :: pos_scol_lat ! temporary
real (r8) :: scol_data(1)
integer :: iscol_data(1)
integer :: petcount
character(len=CL) :: cvalue
character(len=*), parameter :: subname= ' (esm_get_single_column_attributes) '
logical :: unstructured = .false.
!-------------------------------------------------------------------------------

rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1324,7 +1328,15 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid frac')

! Read in domain file for single column
allocate(lats(nj))
! Check for unstructured data ni>1 and nj==1
if (ni.gt.1 .and. nj == 1) unstructured=.true.

if (unstructured) then
allocate(lats(ni))
allocate(pos_lats(ni))
else
allocate(lats(nj))
junwang-noaa marked this conversation as resolved.
Show resolved Hide resolved
end if
allocate(lons(ni))
allocate(pos_lons(ni))
allocate(glob_grid(ni,nj))
Expand All @@ -1334,28 +1346,37 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
count3=(/ni,nj,1/)
status = nf90_get_var(ncid, varid_xc, glob_grid, start3, count3)
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var xc')
do i = 1,ni
lons(i) = glob_grid(i,1)
end do
lons(1:ni) = glob_grid(1:ni,1)
status = nf90_get_var(ncid, varid_yc, glob_grid, start3, count3)
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var yc')
do j = 1,nj
lats(j) = glob_grid(1,j)
end do

if (unstructured) then
lats(1:ni) = glob_grid(1:ni,1)
else
lats(1:nj) = glob_grid(1,1:nj)
end if
! find nearest neighbor indices of scol_lon and scol_lat in single_column_lnd_domain file
! convert lons array and scol_lon to 0,360 and find index of value closest to 0
! and obtain single-column longitude/latitude indices to retrieve
pos_lons(:) = mod(lons(:) + 360._r8, 360._r8)
pos_scol_lon = mod(scol_lon + 360._r8, 360._r8)
start(1) = (MINLOC(abs(pos_lons - pos_scol_lon), dim=1))
start(2) = (MINLOC(abs(lats -scol_lat ), dim=1))

if (unstructured) then
allocate(cols(ni))
pos_lons(:) = mod(lons(:) + 360._r8, 360._r8)
pos_scol_lon = mod(scol_lon + 360._r8, 360._r8)
pos_lats(:) = lats(:) + 90._r8
pos_scol_lat = scol_lat + 90._r8
cols=abs(pos_lons - pos_scol_lon)+abs(pos_lats - pos_scol_lat)
start(1) = MINLOC(cols, dim=1)
start(2) = 1
deallocate(cols)
else
pos_lons(:) = mod(lons(:) + 360._r8, 360._r8)
pos_scol_lon = mod(scol_lon + 360._r8, 360._r8)
start(1) = (MINLOC(abs(pos_lons - pos_scol_lon), dim=1))
start(2) = (MINLOC(abs(lats -scol_lat ), dim=1))
end if
deallocate(lats)
deallocate(lons)
deallocate(pos_lons)
deallocate(glob_grid)

! read in value of nearest neighbor lon and RESET scol_lon and scol_lat
! also get area of gridcell, mask and frac
status = nf90_get_var(ncid, varid_xc, scol_lon, start)
Expand Down
40 changes: 30 additions & 10 deletions mediator/med.F90
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ subroutine SetServices(gcomp, rc)

#ifdef CDEPS_INLINE
!------------------
! phase routine for cdeps inline capabilty
! phase routine for cdeps inline capability
!------------------

call NUOPC_CompSetEntryPoint(gcomp, ESMF_METHOD_RUN, &
Expand Down Expand Up @@ -832,10 +832,10 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc)
if (trim(coupling_mode) == 'cesm') then
call esmFldsExchange_cesm(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode(1:3)) == 'ufs') then
else if (coupling_mode(1:3) == 'ufs') then
call esmFldsExchange_ufs(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode(1:4)) == 'hafs') then
else if (coupling_mode(1:4) == 'hafs') then
call esmFldsExchange_hafs(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else
Expand Down Expand Up @@ -867,13 +867,22 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
read(cvalue,*) is_local%wrap%flds_scalar_index_ny

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", value=cvalue, &
isPresent=isPresent, isSet=isSet,rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
read(cvalue,*) is_local%wrap%flds_scalar_index_ntile
else
is_local%wrap%flds_scalar_index_ntile = 0
end if

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxNextSwCday", value=cvalue, &
isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
read(cvalue,*) is_local%wrap%flds_scalar_index_nextsw_cday
else
is_local%wrap%flds_scalar_index_nextsw_cday = spval
is_local%wrap%flds_scalar_index_nextsw_cday = 0
end if

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxPrecipFactor", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down Expand Up @@ -962,7 +971,7 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc)
endif
if (maintask) then
write(logunit,*) trim(compname(ncomp))//'_use_data_first_import is ', is_local%wrap%med_data_force_first(ncomp)
endif
endif
end if
end do

Expand Down Expand Up @@ -1067,7 +1076,7 @@ subroutine ModifyDecompofMesh(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

!------------------
! Recieve Grids
! Receive Grids
!------------------

do n1 = 1,ncomps
Expand Down Expand Up @@ -1644,7 +1653,7 @@ subroutine DataInitialize(gcomp, rc)
logical :: read_restart
logical :: allDone = .false.
logical,save :: first_call = .true.
real(r8) :: real_nx, real_ny
real(r8) :: real_nx, real_ny, real_ntile
character(len=CX) :: msgString
character(len=*), parameter :: subname = '('//__FILE__//':DataInitialize)'
!-----------------------------------------------------------
Expand Down Expand Up @@ -1832,7 +1841,7 @@ subroutine DataInitialize(gcomp, rc)
if (trim(coupling_mode) == 'cesm') then
call esmFldsExchange_cesm(gcomp, phase='initialize', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode(1:3)) == 'ufs') then
else if (coupling_mode(1:3) == 'ufs') then
call esmFldsExchange_ufs(gcomp, phase='initialize', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (coupling_mode(1:4) == 'hafs') then
Expand Down Expand Up @@ -2128,11 +2137,22 @@ subroutine DataInitialize(gcomp, rc)
flds_scalar_name=is_local%wrap%flds_scalar_name, &
flds_scalar_num=is_local%wrap%flds_scalar_num, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (is_local%wrap%flds_scalar_index_ntile > 0) then
call State_GetScalar(scalar_value=real_ntile, &
scalar_id=is_local%wrap%flds_scalar_index_ntile, &
state=is_local%wrap%NstateImp(n1), &
flds_scalar_name=is_local%wrap%flds_scalar_name, &
flds_scalar_num=is_local%wrap%flds_scalar_num, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
is_local%wrap%ntile(n1) = nint(real_ntile)
else
is_local%wrap%ntile(n1) = 0
end if
is_local%wrap%nx(n1) = nint(real_nx)
is_local%wrap%ny(n1) = nint(real_ny)
write(msgString,'(2i8,2l4)') is_local%wrap%nx(n1), is_local%wrap%ny(n1)
write(msgString,'(3i8)') is_local%wrap%nx(n1), is_local%wrap%ny(n1), is_local%wrap%ntile(n1)
if (maintask) then
write(logunit,'(a)') 'global nx,ny sizes for '//trim(compname(n1))//":"//trim(msgString)
write(logunit,'(a)') 'global nx,ny,ntile sizes for '//trim(compname(n1))//":"//trim(msgString)
end if
call ESMF_LogWrite(trim(subname)//":"//trim(compname(n1))//":"//trim(msgString), ESMF_LOGMSG_INFO)
end if
Expand Down
6 changes: 3 additions & 3 deletions mediator/med_fraction_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ subroutine med_fraction_init(gcomp, rc)
! If ice and atm are on the same mesh - a redist route handle has already been created
maptype = mapfcopy
else
if (trim(coupling_mode(1:9)) == 'ufs.nfrac' ) then
if (coupling_mode(1:9) == 'ufs.nfrac' ) then
maptype = mapnstod_consd
else
maptype = mapconsd
Expand Down Expand Up @@ -345,7 +345,7 @@ subroutine med_fraction_init(gcomp, rc)
! If ocn and atm are on the same mesh - a redist route handle has already been created
maptype = mapfcopy
else
if (trim(coupling_mode(1:9)) == 'ufs.nfrac' ) then
if (coupling_mode(1:9) == 'ufs.nfrac' ) then
maptype = mapnstod_consd
else
maptype = mapconsd
Expand Down Expand Up @@ -756,7 +756,7 @@ subroutine med_fraction_set(gcomp, rc)

call t_startf('MED:'//trim(subname)//' fbfrac(compatm)')
! Determine maptype
if (trim(coupling_mode(1:9)) == 'ufs.nfrac' ) then
if (coupling_mode(1:9) == 'ufs.nfrac' ) then
maptype = mapnstod_consd
else
if (med_map_RH_is_created(is_local%wrap%RH(compice,compatm,:),mapfcopy, rc=rc)) then
Expand Down
8 changes: 6 additions & 2 deletions mediator/med_internalstate_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module med_internalstate_mod
! Present/allowed coupling/active coupling logical flags
logical, pointer :: comp_present(:) ! comp present flag
logical, pointer :: med_coupling_active(:,:) ! computes the active coupling
logical, pointer :: med_data_active(:,:) ! uses stream data to provide background fill
logical, pointer :: med_data_active(:,:) ! uses stream data to provide background fill
logical, pointer :: med_data_force_first(:) ! force to use stream data for first coupling timestep
integer :: num_icesheets ! obtained from attribute
logical :: ocn2glc_coupling = .false. ! obtained from attribute
Expand All @@ -133,12 +133,15 @@ module med_internalstate_mod

! Global nx,ny dimensions of input arrays (needed for mediator history output)
integer, pointer :: nx(:), ny(:)
! Number of nx*ny domains (needed for cubed-sphere and regional domains)
integer, pointer :: ntile(:)

! Import/Export Scalars
character(len=CL) :: flds_scalar_name = ''
integer :: flds_scalar_num = 0
integer :: flds_scalar_index_nx = 0
integer :: flds_scalar_index_ny = 0
integer :: flds_scalar_index_ntile = 0
integer :: flds_scalar_index_nextsw_cday = 0
integer :: flds_scalar_index_precip_factor = 0
real(r8) :: flds_scalar_precip_factor = 1._r8 ! actual value of precip factor from ocn
Expand Down Expand Up @@ -312,6 +315,7 @@ subroutine med_internalstate_init(gcomp, rc)
allocate(is_local%wrap%med_data_force_first(ncomps))
allocate(is_local%wrap%nx(ncomps))
allocate(is_local%wrap%ny(ncomps))
allocate(is_local%wrap%ntile(ncomps))
allocate(is_local%wrap%NStateImp(ncomps))
allocate(is_local%wrap%NStateExp(ncomps))
allocate(is_local%wrap%FBImp(ncomps,ncomps))
Expand Down Expand Up @@ -601,7 +605,7 @@ subroutine med_internalstate_defaultmasks(gcomp, rc)
if (is_local%wrap%comp_present(compocn)) defaultMasks(compocn,:) = 0
if (is_local%wrap%comp_present(compice)) defaultMasks(compice,:) = 0
if (is_local%wrap%comp_present(compwav)) defaultMasks(compwav,:) = 0
if ( trim(coupling_mode(1:3)) == 'ufs') then
if ( coupling_mode(1:3) == 'ufs') then
if (is_local%wrap%comp_present(compatm)) defaultMasks(compatm,:) = 1
endif
if ( trim(coupling_mode) == 'hafs') then
Expand Down
41 changes: 20 additions & 21 deletions mediator/med_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ end function med_io_sec2hms

!===============================================================================
subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
fillval, pre, flds, tavg, use_float, tilesize, rc)
fillval, pre, flds, tavg, use_float, ntile, rc)

!---------------
! Write FB to netcdf file
Expand Down Expand Up @@ -728,7 +728,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
character(len=*), optional , intent(in) :: flds(:) ! specific fields to write out
logical, optional , intent(in) :: tavg ! is this a tavg
logical, optional , intent(in) :: use_float ! write output as float rather than double
integer, optional , intent(in) :: tilesize ! if non-zero, write atm component on tiles
integer, optional , intent(in) :: ntile ! number of nx * ny tiles
integer , intent(out):: rc

! local variables
Expand All @@ -754,7 +754,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
character(CS) :: coordvarnames(2) ! coordinate variable names
character(CS) :: coordnames(2) ! coordinate long names
character(CS) :: coordunits(2) ! coordinate units
integer :: lnx,lny
integer :: lnx,lny,lntile
logical :: luse_float
real(r8) :: lfillvalue
integer, pointer :: minIndexPTile(:,:)
Expand All @@ -770,8 +770,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
integer :: rank
integer :: ungriddedUBound(1) ! currently the size must equal 1 for rank 2 fields
integer :: gridToFieldMap(1) ! currently the size must equal 1 for rank 2 fields
logical :: atmtiles
integer :: ntiles = 1
logical :: tiles
character(CL), allocatable :: fieldNameList(:)
character(*),parameter :: subName = '(med_io_write_FB) '
!-------------------------------------------------------------------------------
Expand All @@ -785,9 +784,9 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
luse_float = .false.
if (present(use_float)) luse_float = use_float

atmtiles = .false.
if (present(tilesize)) then
if (tilesize > 0) atmtiles = .true.
tiles = .false.
if (present(ntile)) then
if (ntile > 0) tiles = .true.
end if

! Error check
Expand Down Expand Up @@ -870,14 +869,14 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
! all the global grid values in the distgrid - e.g. CTSM

ng = maxval(maxIndexPTile)
if (atmtiles) then
lnx = tilesize
lny = tilesize
ntiles = ng/(lnx*lny)
write(tmpstr,*) subname, 'ng,lnx,lny,ntiles = ',ng,lnx,lny,ntiles
if (tiles) then
lnx = nx
lny = ny
lntile = ng/(lnx*lny)
write(tmpstr,*) subname, 'ng,lnx,lny,lntile = ',ng,lnx,lny,lntile
call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO)
if (ntiles /= 6) then
call ESMF_LogWrite(trim(subname)//' ERROR: only cubed sphere atm tiles valid ', ESMF_LOGMSG_INFO)
if (lntile /= ntile) then
call ESMF_LogWrite(trim(subname)//' ERROR: grid2d size and ntile are not consistent ', ESMF_LOGMSG_INFO)
call ESMF_Finalize(endflag=ESMF_END_ABORT)
endif
else
Expand All @@ -900,10 +899,10 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &

! Write header
if (whead) then
if (atmtiles) then
if (tiles) then
rcode = pio_def_dim(io_file, trim(lpre)//'_nx', lnx, dimid3(1))
rcode = pio_def_dim(io_file, trim(lpre)//'_ny', lny, dimid3(2))
rcode = pio_def_dim(io_file, trim(lpre)//'_ntiles', ntiles, dimid3(3))
rcode = pio_def_dim(io_file, trim(lpre)//'_ntile', ntile, dimid3(3))
if (present(nt)) then
dimid4(1:3) = dimid3
rcode = pio_inq_dimid(io_file, 'time', dimid4(4))
Expand Down Expand Up @@ -1020,8 +1019,8 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
call ESMF_DistGridGet(distgrid, localDE=0, seqIndexList=dof, rc=rc)
write(tmpstr,*) subname,' dof = ',ns,size(dof),dof(1),dof(ns) !,minval(dof),maxval(dof)
call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO)
if (atmtiles) then
call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny,ntiles/), dof, iodesc)
if (tiles) then
call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny,ntile/), dof, iodesc)
else
call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny/), dof, iodesc)
!call pio_writedof(lpre, (/lnx,lny/), int(dof,kind=PIO_OFFSET_KIND), mpicom)
Expand Down Expand Up @@ -1579,8 +1578,8 @@ subroutine med_io_read_FB(filename, vm, FB, pre, frame, rc)
allocate(fldptr1_tmp(lsize))

do n = 1,ungriddedUBound(1)
! Creat a name for the 1d field on the mediator history or restart file based on the
! ungridded dimension index of the field bundle 2d fiedl
! Create a name for the 1d field on the mediator history or restart file based on the
! ungridded dimension index of the field bundle 2d field
write(cnumber,'(i0)') n
name1 = trim(lpre)//'_'//trim(itemc)//trim(cnumber)

Expand Down
Loading