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

add Cgrid-related fixes for nuopc/cmeps #728

Merged
merged 127 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
0338d04
Merge pull request #1 from CICE-Consortium/master
DeniseWorthen Feb 25, 2020
99470ed
Merge pull request #2 from CICE-Consortium/master
DeniseWorthen Mar 7, 2020
71d2ded
Merge pull request #3 from CICE-Consortium/master
DeniseWorthen Apr 2, 2020
d46d691
merge latest master (#4)
DeniseWorthen Apr 22, 2020
183218a
updated orbital calculations needed for cesm
Apr 23, 2020
10e7c20
fixed problems in updated orbital calculations needed for cesm
Apr 29, 2020
ce8e5a9
update CICE6 to support coupling with UFS
apcraig May 10, 2020
8f0b5ee
Merge pull request #2 from apcraig/ufs01
dabail10 May 10, 2020
7ac0e3d
Merge pull request #1 from ESCOMP/nuopc
DeniseWorthen May 12, 2020
80c9e6e
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 May 19, 2020
53715ea
put in changes so that both ufsatm and cesm requirements for potentia…
May 25, 2020
7e43703
Merge pull request #3 from mvertens/mvertens/nuopc
dabail10 May 26, 2020
397e588
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jun 2, 2020
3bb3694
Convergence on ustar for CICE. (#452) (#5)
DeniseWorthen Jun 5, 2020
f41f1e9
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 22, 2020
e70d1ab
update icepack submodule
DeniseWorthen Jun 22, 2020
308a1d4
Revert "update icepack submodule"
DeniseWorthen Jun 22, 2020
7848fdf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 24, 2020
6982ee4
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 25, 2020
089f60f
update comp_ice.backend with temporary ice_timers fix
DeniseWorthen Jun 25, 2020
6affdcf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 29, 2020
b5a6058
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
415df0e
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
b4da8a6
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
239c7de
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
ad03424
Fix threading problem in init_bgc
dabail10 Jul 1, 2020
73e7774
Fix additional OMP problems
dabail10 Jul 1, 2020
46fcfba
changes for coldstart running
DeniseWorthen Jul 2, 2020
c762336
Move the forapps directory
dabail10 Jul 2, 2020
6bccf71
remove cesmcoupled ifdefs
DeniseWorthen Jul 2, 2020
902e883
Fix logging issues for NUOPC
dabail10 Jul 2, 2020
178693a
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 2, 2020
b4afd2e
removal of many cpp-ifdefs
Jul 4, 2020
3a1b88b
fix compile errors
DeniseWorthen Jul 4, 2020
41855fd
fixes to get cesm working
Jul 4, 2020
aea1aa8
update to latest nuopc changes
Jul 4, 2020
e4c989c
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 6, 2020
30a81cc
fixed white space issue
Jul 7, 2020
8ebdda9
Merge pull request #4 from mvertens/nuopc
dabail10 Jul 7, 2020
27dd3b7
Add restart_coszen namelist option
dabail10 Jul 7, 2020
50bf856
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jul 7, 2020
6b4a277
Merge branch 'nuopc' into coszen
dabail10 Jul 7, 2020
93f0e86
Merge pull request #5 from ESCOMP/coszen
dabail10 Jul 7, 2020
f92bef3
update icepack submodule
DeniseWorthen Jul 7, 2020
4e8cc79
Merge remote-tracking branch 'upstream/nuopc' into emc/develop
DeniseWorthen Jul 7, 2020
8ff4ee0
change Orion to orion in backend
DeniseWorthen Jul 7, 2020
916c6af
add -link_mpi=dbg to debug flags (#8)
DeniseWorthen Jul 14, 2020
9bdb9ad
Merge remote-tracking branch 'CICE-Consortium/master' into emc/develop
DeniseWorthen Jul 15, 2020
8f37bfc
cice6 compile (#6)
MinsukJi-NOAA Jul 17, 2020
86b8dab
Merge remote-tracking branch 'upstream/emc/develop' into HEAD
DeniseWorthen Jul 17, 2020
c084de4
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Jul 17, 2020
88cc2fd
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 5, 2020
bdf1a1f
changes for consistency w/ current emc-cice5 (#13)
DeniseWorthen Aug 12, 2020
5ecde75
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 12, 2020
d81a834
Fixcommit (#14)
DeniseWorthen Aug 13, 2020
4d7ba5b
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 13, 2020
5dcfca8
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 13, 2020
285985c
Update CICE6 for integration to S2S
DeniseWorthen Aug 31, 2020
6d30789
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 31, 2020
8129aab
Merge remote-tracking branch 'consortium/master' into emc/develop
DeniseWorthen Aug 31, 2020
ac617cd
Support TACC stampede (#19)
MinsukJi-NOAA Oct 8, 2020
23cdee7
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Oct 8, 2020
1e4f42b
update icepack
DeniseWorthen Oct 30, 2020
2515f77
Merge remote-tracking branch 'consortium/master' into feature/updcice
DeniseWorthen Oct 30, 2020
41afe74
add ice_dyn_vp module to CICE_InitMod
DeniseWorthen Oct 30, 2020
2a0f332
update gitmodules, update icepack
DeniseWorthen Nov 10, 2020
f773ef3
Update CICE to consortium master (#23)
DeniseWorthen Nov 10, 2020
840e931
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Nov 10, 2020
1e4d393
Merge remote-tracking branch 'upstream/emc/develop' into feature/updcice
DeniseWorthen Mar 14, 2021
66546ae
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Mar 14, 2021
2eca569
update icepack
DeniseWorthen Apr 5, 2021
b52e91c
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Apr 5, 2021
51db2f9
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 1, 2021
d8fb6d9
switch icepack branches
DeniseWorthen Jun 2, 2021
9a76541
update icepack
DeniseWorthen Jun 4, 2021
519d339
Update CICE to latest Consortium master (#26)
DeniseWorthen Jun 4, 2021
74e7b58
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 5, 2021
9d88d92
add cice changes for zlvs (#29)
DeniseWorthen Jun 10, 2021
d1f2d15
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 11, 2021
0c39047
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Jun 24, 2021
f3b2652
update icepack and pointer
DeniseWorthen Jun 24, 2021
9057817
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 24, 2021
1721728
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jul 2, 2021
55586f7
update icepack and revert gitmodules
DeniseWorthen Jul 20, 2021
441f693
Fix history features
apcraig Aug 10, 2021
15763d8
revert set_nml.histall
apcraig Aug 10, 2021
b3364a6
fix implementation error
apcraig Aug 11, 2021
96d5851
update model log output in ice_init
apcraig Aug 11, 2021
7b5c2b4
Fix QC issues
apcraig Aug 12, 2021
c5794b4
Update testing
apcraig Aug 13, 2021
eaa3c3a
update documentation
apcraig Aug 13, 2021
e31ce7e
reset calchk to 100000 years
apcraig Aug 13, 2021
83068c7
update evp1d test
apcraig Aug 13, 2021
3fd897e
Merge branch 'master' of https://github.com/cice-consortium/cice into…
apcraig Aug 13, 2021
4373d3d
update icepack
DeniseWorthen Aug 15, 2021
71f4fe6
Merge remote-tracking branch 'TCraig/tmB' into feature/updcice
DeniseWorthen Aug 15, 2021
aeb473a
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 20, 2021
aade124
update icepack
DeniseWorthen Aug 20, 2021
7f089d0
add memory profiling (#36)
DeniseWorthen Aug 23, 2021
397b4bd
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Aug 26, 2021
a1b3375
update icepack
DeniseWorthen Aug 31, 2021
7d2139c
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 31, 2021
cd021b5
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Sep 1, 2021
5cb78cd
fix rhoa when lowest_temp is 0.0
DeniseWorthen Sep 15, 2021
d0a45a2
update icepack submodule
DeniseWorthen Sep 16, 2021
2540695
Update CICE for latest Consortium master (#38)
DeniseWorthen Sep 16, 2021
8a88024
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Sep 20, 2021
d95bd51
Use CICE-Consortium/Icepack master (#40)
DeniseWorthen Oct 1, 2021
d83c67b
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Oct 12, 2021
8d4a3c6
recreate cap update branch (#42)
DeniseWorthen Nov 22, 2021
55bf9f4
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 29, 2021
7a0b65e
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Nov 30, 2021
abbebab
remove 2 extraneous lines
DeniseWorthen Nov 30, 2021
8ff0fb2
duplicate gitmodule style for icepack
DeniseWorthen Nov 30, 2021
27dfd1b
Update CICE to latest Consortium/main (#45)
DeniseWorthen Feb 24, 2022
c660075
Update CICE to Consortium/main (#48)
DeniseWorthen May 10, 2022
4b28dfe
Merge remote-tracking branch 'Consortium/main' into feature/addCgrid
DeniseWorthen May 14, 2022
247dc1d
fix comment, fix env for orion and hera
DeniseWorthen May 14, 2022
dd158e2
replace save_init with step_prep in CICE_RunMod
DeniseWorthen May 14, 2022
ae50efe
fixes for cgrid repro
DeniseWorthen May 22, 2022
cbc6046
remove added haloupdates
DeniseWorthen May 24, 2022
ab95d2d
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 2, 2022
a38df37
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 13, 2022
2d5487a
change F->S for ocean velocities and tilts
DeniseWorthen Jun 13, 2022
26498db
fix debug failure when grid_ice=C
DeniseWorthen Jun 20, 2022
9e2dd69
respond to review comments
DeniseWorthen Jun 22, 2022
cc0f89c
remove inserted whitespace for uvelE,N and vvelE,N
DeniseWorthen Jun 22, 2022
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
Prev Previous commit
Next Next commit
update CICE6 to support coupling with UFS
  • Loading branch information
apcraig committed May 10, 2020
commit ce8e5a97d051dd9ff4715f6eec6829271d774836
4 changes: 2 additions & 2 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ subroutine input_data
kmt_file = 'unknown_kmt_file'
version_name = 'unknown_version_name'
ncat = 0 ! number of ice thickness categories
nfsd = 0 ! number of floe size categories (1 = default)
nfsd = 1 ! number of floe size categories (1 = default)
nilyr = 0 ! number of vertical ice layers
nslyr = 0 ! number of vertical snow layers
nblyr = 0 ! number of bio layers
Expand Down Expand Up @@ -748,7 +748,7 @@ subroutine input_data
ice_ic /= 'none' .and. ice_ic /= 'default') then
if (my_task == master_task) then
write(nu_diag,*) subname//' ERROR: runtype, restart, ice_ic are inconsistent:'
write(nu_diag,*) subname//' ERROR: runtype=',trim(runtype), 'restart=',restart, 'ice_ic=',trim(ice_ic)
write(nu_diag,*) subname//' ERROR: runtype=',trim(runtype), ' restart=',restart, ' ice_ic=',trim(ice_ic)
write(nu_diag,*) subname//' ERROR: Please review user guide'
endif
abort_flag = 1
Expand Down
2 changes: 1 addition & 1 deletion cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ subroutine cice_init(mpicom_ice)
! coupler communication or forcing data initialization
!--------------------------------------------------------------------

#ifndef coupled
call init_forcing_atmo ! initialize atmospheric forcing (standalone)

#ifndef coupled
#ifndef CESMCOUPLED
if (tr_fsd .and. wave_spec) call get_wave_spec ! wave spectrum in ice
call get_forcing_atmo ! atmospheric forcing from data
Expand Down
4 changes: 4 additions & 0 deletions cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
module CICE_RunMod

use ice_kinds_mod
#ifdef CESMCOUPLED
use perf_mod, only : t_startf, t_stopf, t_barrierf
#endif
use ice_fileunits, only: nu_diag
use ice_arrays_column, only: oceanmixed_ice
use ice_constants, only: c0, c1
Expand Down Expand Up @@ -207,12 +209,14 @@ subroutine ice_step
call init_history_bgc
call ice_timer_stop(timer_diags) ! diagnostics/history

#ifdef CESMCOUPLED
if (prescribed_ice) then ! read prescribed ice
call t_barrierf('cice_run_presc_BARRIER',MPI_COMM_ICE)
call t_startf ('cice_run_presc')
call ice_prescribed_run(idate, sec)
call t_stopf ('cice_run_presc')
endif
#endif

call save_init

Expand Down
206 changes: 145 additions & 61 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90

Large diffs are not rendered by default.

72 changes: 61 additions & 11 deletions cicecore/drivers/nuopc/cmeps/ice_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module ice_import_export
use ESMF
use NUOPC
use NUOPC_Model
use shr_sys_mod , only : shr_sys_abort, shr_sys_flush
#ifdef CESMCOUPLED
use shr_frz_mod , only : shr_frz_freezetemp
use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs
use ice_kinds_mod , only : int_kind, dbl_kind, char_len_long, log_kind
#endif
use ice_kinds_mod , only : int_kind, dbl_kind, char_len, log_kind
use ice_constants , only : c0, c1, spval_dbl
use ice_constants , only : field_loc_center, field_type_scalar, field_type_vector
use ice_blocks , only : block, get_block, nx_block, ny_block
Expand All @@ -23,7 +23,7 @@ module ice_import_export
use ice_flux , only : fresh, fsalt, zlvl, uatm, vatm, potT, Tair, Qa
use ice_flux , only : rhoa, swvdr, swvdf, swidr, swidf, flw, frain
use ice_flux , only : fsnow, uocn, vocn, sst, ss_tltx, ss_tlty, frzmlt
use ice_flux , only : sss, tf, wind, fsw
use ice_flux , only : sss, Tf, wind, fsw
#if (defined NEWCODE)
use ice_flux , only : faero_atm, faero_ocn
use ice_flux , only : fiso_atm, fiso_ocn, fiso_rain, fiso_evap
Expand All @@ -33,13 +33,16 @@ module ice_import_export
use ice_grid , only : tlon, tlat, tarea, tmask, anglet, hm, ocn_gridcell_frac
use ice_grid , only : grid_type, t2ugrid_vector
use ice_boundary , only : ice_HaloUpdate
use ice_fileunits , only : nu_diag
use ice_fileunits , only : nu_diag, flush_fileunit
use ice_communicate , only : my_task, master_task, MPI_COMM_ICE
use ice_prescribed_mod , only : prescribed_ice
use ice_shr_methods , only : chkerr, state_reset
use icepack_intfc , only : icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc , only : icepack_query_parameters, icepack_query_tracer_flags
use icepack_intfc , only : icepack_liquidus_temperature
#ifdef CESMCOUPLED
use perf_mod , only : t_startf, t_stopf, t_barrierf
#endif

implicit none
public
Expand Down Expand Up @@ -107,8 +110,8 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam

! local variables
integer :: n
character(CS) :: stdname
character(CS) :: cvalue
character(char_len) :: stdname
character(char_len) :: cvalue
logical :: flds_wiso ! use case
logical :: flds_i2o_per_cat ! .true. => select per ice thickness category
character(len=*), parameter :: subname='(ice_import_export:ice_advertise_fields)'
Expand All @@ -117,6 +120,9 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
rc = ESMF_SUCCESS
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

flds_wiso = .false.
flds_i2o_per_cat = .false.
#ifdef CESMCOUPLED
call NUOPC_CompAttributeGet(gcomp, name='flds_wiso', value=cvalue, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
read(cvalue,*) flds_wiso
Expand All @@ -127,6 +133,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
if (ChkErr(rc,__LINE__,u_FILE_u)) return
read(cvalue,*) send_i2x_per_cat
call ESMF_LogWrite('flds_i2o_per_cat = '// trim(cvalue), ESMF_LOGMSG_INFO)
#endif
#endif

!-----------------
Expand Down Expand Up @@ -154,7 +161,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
call fldlist_add(fldsToIce_num, fldsToIce, 'inst_spec_humid_height_lowest' )
call fldlist_add(fldsToIce_num, fldsToIce, 'inst_temp_height_lowest' )
call fldlist_add(fldsToIce_num, fldsToIce, 'Sa_ptem' )
call fldlist_add(fldsToIce_num, fldsToIce, 'air_density_height_lowest' )
call fldlist_add(fldsToIce_num, fldsToIce, 'air_density_height_lowest' )
call fldlist_add(fldsToIce_num, fldsToIce, 'mean_down_sw_vis_dir_flx' )
call fldlist_add(fldsToIce_num, fldsToIce, 'mean_down_sw_ir_dir_flx' )
call fldlist_add(fldsToIce_num, fldsToIce, 'mean_down_sw_vis_dif_flx' )
Expand All @@ -163,6 +170,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
call fldlist_add(fldsToIce_num, fldsToIce, 'mean_prec_rate' )
call fldlist_add(fldsToIce_num, fldsToIce, 'mean_fprec_rate' )

#ifdef CESMCOUPLED
! from atm - black carbon deposition fluxes (3)
call fldlist_add(fldsToIce_num, fldsToIce, 'Faxa_bcph', ungridded_lbound=1, ungridded_ubound=3)

Expand All @@ -171,6 +179,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam

! from - atm dry dust deposition frluxes (4 sizes)
call fldlist_add(fldsToIce_num, fldsToIce, 'Faxa_dstdry', ungridded_lbound=1, ungridded_ubound=4)
#endif

do n = 1,fldsToIce_num
call NUOPC_Advertise(importState, standardName=fldsToIce(n)%stdname, &
Expand Down Expand Up @@ -231,9 +240,11 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
call fldlist_add(fldsFrIce_num , fldsFrIce, 'mean_salt_rate' )
call fldlist_add(fldsFrIce_num , fldsFrIce, 'stress_on_ocn_ice_zonal' )
call fldlist_add(fldsFrIce_num , fldsFrIce, 'stress_on_ocn_ice_merid' )
#ifdef CESMCOUPLED
call fldlist_add(fldsFrIce_num , fldsFrIce, 'Fioi_bcpho' )
call fldlist_add(fldsFrIce_num , fldsFrIce, 'Fioi_bcphi' )
call fldlist_add(fldsFrIce_num , fldsFrIce, 'Fioi_flxdst' )
#endif
if (flds_wiso) then
call fldlist_add(fldsFrIce_num, fldsFrIce, 'mean_fresh_water_to_ocean_rate_wiso', &
ungridded_lbound=1, ungridded_ubound=3)
Expand Down Expand Up @@ -388,6 +399,7 @@ subroutine ice_import( importState, rc )
call state_getimport(importState, 'inst_height_lowest', output=aflds, index=3, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

!tcx errr.... this needs to be fixed in the dictionary!!!
call state_getimport(importState, 'Sa_ptem', output=aflds, index=4, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -431,9 +443,13 @@ subroutine ice_import( importState, rc )
! perform a halo update

if (.not.prescribed_ice) then
#ifdef CESMCOUPLED
call t_startf ('cice_imp_halo')
#endif
call ice_HaloUpdate(aflds, halo_info, field_loc_center, field_type_scalar)
#ifdef CESMCOUPLED
call t_stopf ('cice_imp_halo')
#endif
endif

! now fill in the ice internal data types
Expand Down Expand Up @@ -485,9 +501,13 @@ subroutine ice_import( importState, rc )


if (.not.prescribed_ice) then
#ifdef CESMCOUPLED
call t_startf ('cice_imp_halo')
#endif
call ice_HaloUpdate(aflds, halo_info, field_loc_center, field_type_vector)
#ifdef CESMCOUPLED
call t_stopf ('cice_imp_halo')
#endif
endif

!$OMP PARALLEL DO PRIVATE(iblk,i,j)
Expand Down Expand Up @@ -600,7 +620,9 @@ subroutine ice_import( importState, rc )
! interpolate across the pole)
! use ANGLET which is on the T grid !

#ifdef CESMCOUPLED
call t_startf ('cice_imp_ocn')
#endif
!$OMP PARALLEL DO PRIVATE(iblk,i,j,workx,worky)
do iblk = 1, nblocks

Expand All @@ -624,33 +646,47 @@ subroutine ice_import( importState, rc )
sst(i,j,iblk) = sst(i,j,iblk) - Tffresh ! sea sfc temp (C)

sss(i,j,iblk) = max(sss(i,j,iblk),c0)
#ifndef CESMCOUPLED
!tcx should this be icepack_sea_freezing_temperature?
Tf (i,j,iblk) = icepack_liquidus_temperature(sss(i,j,iblk))
#endif
enddo
enddo

! Use shr_frz_mod for this
#ifdef CESMCOUPLED
! Use shr_frz_mod for this, overwrite Tf computed above
Tf(:,:,iblk) = shr_frz_freezetemp(sss(:,:,iblk))
#endif

enddo
!$OMP END PARALLEL DO
#ifdef CESMCOUPLED
call t_stopf ('cice_imp_ocn')
#endif

! Interpolate ocean dynamics variables from T-cell centers to
! U-cell centers.

if (.not.prescribed_ice) then
#ifdef CESMCOUPLED
call t_startf ('cice_imp_t2u')
#endif
call t2ugrid_vector(uocn)
call t2ugrid_vector(vocn)
call t2ugrid_vector(ss_tltx)
call t2ugrid_vector(ss_tlty)
#ifdef CESMCOUPLED
call t_stopf ('cice_imp_t2u')
#endif
end if

! Atmosphere variables are needed in T cell centers in
! subroutine stability and are interpolated to the U grid
! later as necessary.

#ifdef CESMCOUPLED
call t_startf ('cice_imp_atm')
#endif
!$OMP PARALLEL DO PRIVATE(iblk,i,j,workx,worky)
do iblk = 1, nblocks
do j = 1, ny_block
Expand All @@ -671,7 +707,9 @@ subroutine ice_import( importState, rc )
enddo
enddo
!$OMP END PARALLEL DO
#ifdef CESMCOUPLED
call t_stopf ('cice_imp_atm')
#endif

end subroutine ice_import

Expand Down Expand Up @@ -787,7 +825,7 @@ subroutine ice_export( exportState, rc )
if (tmask(i,j,iblk) .and. ailohi(i,j,iblk) < c0 ) then
write(nu_diag,*) &
' (ice) send: ERROR ailohi < 0.0 ',i,j,ailohi(i,j,iblk)
call shr_sys_flush(nu_diag)
call flush_fileunit(nu_diag)
endif
end do
end do
Expand Down Expand Up @@ -1083,7 +1121,7 @@ subroutine fldlist_add(num, fldlist, stdname, ungridded_lbound, ungridded_ubound

num = num + 1
if (num > fldsMax) then
call shr_sys_abort(trim(subname)//": ERROR num > fldsMax "//trim(stdname))
call abort_ice(trim(subname)//": ERROR num > fldsMax "//trim(stdname))
endif
fldlist(num)%stdname = trim(stdname)

Expand Down Expand Up @@ -1270,6 +1308,9 @@ subroutine state_getimport_4d_output(state, fldname, output, index, do_sum, ungr

rc = ESMF_SUCCESS

! check that fieldname exists
if (.not. State_FldChk(state, trim(fldname))) return

if (geomtype == ESMF_GEOMTYPE_MESH) then

! get field pointer
Expand Down Expand Up @@ -1381,6 +1422,9 @@ subroutine state_getimport_3d_output(state, fldname, output, do_sum, ungridded_i

rc = ESMF_SUCCESS

! check that fieldname exists
if (.not. State_FldChk(state, trim(fldname))) return

if (geomtype == ESMF_GEOMTYPE_MESH) then

! get field pointer
Expand Down Expand Up @@ -1486,6 +1530,9 @@ subroutine state_setexport_4d_input(state, fldname, input, index, lmask, ifrac,

rc = ESMF_SUCCESS

! check that fieldname exists
if (.not. State_FldChk(state, trim(fldname))) return

if (geomtype == ESMF_GEOMTYPE_MESH) then

! get field pointer
Expand Down Expand Up @@ -1600,6 +1647,9 @@ subroutine state_setexport_3d_input(state, fldname, input, lmask, ifrac, ungridd

rc = ESMF_SUCCESS

! check that fieldname exists
if (.not. State_FldChk(state, trim(fldname))) return

if (geomtype == ESMF_GEOMTYPE_MESH) then

! get field pointer
Expand Down
11 changes: 10 additions & 1 deletion cicecore/drivers/nuopc/cmeps/ice_prescribed_mod.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
module ice_prescribed_mod

#ifdef CESMCOUPLED
#ifndef CESMCOUPLED

use ice_kinds_mod

implicit none
private ! except

logical(kind=log_kind), parameter, public :: prescribed_ice = .false. ! true if prescribed ice

#else

! !DESCRIPTION:
! The prescribed ice model reads in ice concentration data from a netCDF
Expand Down
Loading