Skip to content

Commit

Permalink
NUOPC driver updates (#611)
Browse files Browse the repository at this point in the history
* updated orbital calculations needed for cesm

* fixed problems in updated orbital calculations needed for cesm

* update CICE6 to support coupling with UFS

* put in changes so that both ufsatm and cesm requirements for potential temperature and density are satisfied

* update icepack submodule

* Revert "update icepack submodule"

This reverts commit e70d1ab.

* update comp_ice.backend with temporary ice_timers fix

* Fix threading problem in init_bgc

* Fix additional OMP problems

* changes for coldstart running

* Move the forapps directory

* remove cesmcoupled ifdefs

* Fix logging issues for NUOPC

* removal of many cpp-ifdefs

* fix compile errors

* fixes to get cesm working

* fixed white space issue

* Add restart_coszen namelist option

* Update NUOPC cap to work with latest CICE6 master

* nuopc,cmeps or s2s build updates

* fixes for dbug_flag

* Update nuopc2 to latest CICE master

* Fix some merge problems

* Fix dbug variable

* Manual merge of UFS changes

* fixes to get CESM B1850 compset working

* refactored ice_prescribed_mod.F90 to work with cdeps rather than the mct data models

* Fix use_restart_time

* changes for creating masks at runtime

* added ice_mesh_mod

* implemented area correction factors as option

* more cleanup

* Fix dragio

* Fix mushy bug

* updates to nuopc cap to resolve inconsistency between driver inputs and cice namelists

* changed error message

* added icepack_warnings_flush

* updates to get ice categories working

* updates to have F compset almost working with cice6 - still problems in polar regions - need to resolve 253K/cice6 versus 273K/cice5 differences

* changed tolerance of mesh/grid comparison

* added issues raised in PR

* Update CESM-CICE sync with new time manager

* Add back in latlongrid

Co-authored-by: Mariana Vertenstein <mvertens@ucar.edu>
Co-authored-by: apcraig <anthony.p.craig@gmail.com>
Co-authored-by: Denise Worthen <denise.worthen@noaa.gov>
4 people authored Jun 22, 2021
1 parent ff88891 commit 291dfa0
Showing 4 changed files with 11 additions and 23 deletions.
6 changes: 2 additions & 4 deletions cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
@@ -720,10 +720,8 @@ subroutine init_coupler_flux
ffep (:,:,:,:)= c0
ffed (:,:,:,:)= c0

if (send_i2x_per_cat) then
allocate(fswthrun_ai(nx_block,ny_block,ncat,max_blocks))
fswthrun_ai(:,:,:,:) = c0
endif
allocate(fswthrun_ai(nx_block,ny_block,ncat,max_blocks))
fswthrun_ai(:,:,:,:) = c0

!-----------------------------------------------------------------
! derived or computed fields
1 change: 0 additions & 1 deletion cicecore/cicedynB/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
@@ -1170,7 +1170,6 @@ subroutine latlongrid

end subroutine latlongrid
#endif

!=======================================================================

! Regular rectangular grid and mask
24 changes: 6 additions & 18 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ module ice_comp_nuopc
use ice_grid , only : grid_type, init_grid2
use ice_communicate , only : init_communicate, my_task, master_task, mpi_comm_ice
use ice_calendar , only : force_restart_now, write_ic
use ice_calendar , only : idate, mday, mmonth, year_init, timesecs
use ice_calendar , only : idate, mday, mmonth, myear, year_init
use ice_calendar , only : msec, dt, calendar, calendar_type, nextsw_cday, istep
use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long
use ice_fileunits , only : nu_diag, nu_diag_set, inst_index, inst_name
@@ -214,7 +214,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
integer :: ref_ymd ! Reference date (YYYYMMDD)
integer :: ref_tod ! reference time of day (s)
integer :: yy,mm,dd ! Temporaries for time query
integer :: iyear ! yyyy
integer :: dtime ! time step
integer :: shrlogunit ! original log unit
character(len=char_len) :: starttype ! infodata start type
@@ -602,7 +601,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
!----------------------------------------------------------------------------
! Second cice initialization phase -after initializing grid info
!----------------------------------------------------------------------------

! Note that cice_init2 also sets time manager info as well as mpi communicator info,
! including master_task and my_task
! Note that cice_init2 calls ice_init() which in turn calls icepack_init_parameters
@@ -639,7 +637,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)

! - on initial run
! - iyear, month and mday obtained from sync clock
! - time determined from iyear, month and mday
! - time determined from myear, month and mday
! - istep0 and istep1 are set to 0
! - on restart run
! - istep0, time and time_forc are read from restart file
@@ -668,28 +666,18 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if
call abort_ice(subname//' :: ERROR idate lt zero')
endif
iyear = (idate/10000) ! integer year of basedate
mmonth= (idate-iyear*10000)/100 ! integer month of basedate
mday = idate-iyear*10000-mmonth*100 ! day of month of basedate
myear = (idate/10000) ! integer year of basedate
mmonth= (idate-myear*10000)/100 ! integer month of basedate
mday = idate-myear*10000-mmonth*100 ! day of month of basedate

if (my_task == master_task) then
write(nu_diag,*) trim(subname),' curr_ymd = ',curr_ymd
write(nu_diag,*) trim(subname),' cice year_init = ',year_init
write(nu_diag,*) trim(subname),' cice start date = ',idate
write(nu_diag,*) trim(subname),' cice start ymds = ',iyear,mmonth,mday,start_tod
write(nu_diag,*) trim(subname),' cice start ymds = ',myear,mmonth,mday,start_tod
write(nu_diag,*) trim(subname),' cice calendar_type = ',trim(calendar_type)
endif

#ifdef CESMCOUPLED
if (calendar_type == "GREGORIAN" .or. &
calendar_type == "Gregorian" .or. &
calendar_type == "gregorian") then
call time2sec(iyear-(year_init-1),mmonth,mday,time)
else
call time2sec(iyear-year_init,mmonth,mday,time)
endif
#endif
timesecs = timesecs+start_tod
end if

call calendar() ! update calendar info
3 changes: 3 additions & 0 deletions cicecore/drivers/nuopc/cmeps/ice_import_export.F90
Original file line number Diff line number Diff line change
@@ -130,6 +130,9 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
if (my_task == master_task) then
write(nu_diag,*)'send_i2x_per_cat = ',send_i2x_per_cat
end if
if (.not.send_i2x_per_cat) then
deallocate(fswthrun_ai)
end if

! Determine if the following attributes are sent by the driver and if so read them in
flds_wiso = .false.

0 comments on commit 291dfa0

Please sign in to comment.