diff --git a/cicecore/drivers/access/cmeps/CICE_InitMod.F90 b/cicecore/drivers/access/cmeps/CICE_InitMod.F90 index 0ba672f3d..2d2b692ad 100644 --- a/cicecore/drivers/access/cmeps/CICE_InitMod.F90 +++ b/cicecore/drivers/access/cmeps/CICE_InitMod.F90 @@ -50,6 +50,8 @@ subroutine cice_init1() file=__FILE__,line= __LINE__) call input_data ! namelist variables + call access_verify_inputs + call input_zbgc ! vertical biogeochemistry namelist call count_tracers ! count tracers @@ -465,6 +467,28 @@ end subroutine init_restart !======================================================================= + subroutine access_verify_inputs() + ! Check required namelist settings for ACCESS CM3 + logical(kind=log_kind) :: & + tr_pond_lvl + character(len=*), parameter :: subname = '(access_verify_inputs)' + + + call icepack_query_tracer_flags(tr_pond_lvl_out=tr_pond_lvl) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(trim(subname), & + file=__FILE__,line= __LINE__) + + if (tr_pond_lvl) then + write(nu_diag,*) subname//' ERROR: Wrong meltpond scheme selected' + write(nu_diag,*) subname//' ERROR: tr_pond_lvl = ', tr_pond_lvl + call abort_ice (error_message=subname//' Level pond scheme not supported in ACCESS CM3 coupling', & + file=__FILE__, line=__LINE__) + end if + + end subroutine access_verify_inputs + !======================================================================= + end module CICE_InitMod !======================================================================= diff --git a/cicecore/drivers/access/cmeps/ice_import_export.F90 b/cicecore/drivers/access/cmeps/ice_import_export.F90 index 62de912a0..1653a2246 100644 --- a/cicecore/drivers/access/cmeps/ice_import_export.F90 +++ b/cicecore/drivers/access/cmeps/ice_import_export.F90 @@ -2035,7 +2035,7 @@ subroutine ice_export_access(importState, exportState, ailohi, cpl_dt, rc) use icepack_therm_shared, only: calculate_Tin_from_qin use ice_state, only: aicen, vsnon, vicen, trcrn ! use icepack_therm_itd, only: nt_hpnd, - use icepack_tracers, only: nt_qsno, nt_hpnd, nt_sice, nt_qice + use icepack_tracers, only: nt_qsno, nt_hpnd, nt_apnd, nt_sice, nt_qice use ice_arrays_column, only: apeffn ! input/output variables @@ -2051,6 +2051,7 @@ subroutine ice_export_access(importState, exportState, ailohi, cpl_dt, rc) integer :: ilo, ihi, jlo, jhi ! beginning and end of physical domain logical :: flag real (kind=dbl_kind), allocatable :: tempfld(:,:,:), tempfld1(:,:,:), ki_fld(:,:,:,:), hi1_fld(:,:,:,:) + real (kind=dbl_kind), allocatable :: pndfn_scaled(:,:,:,:), pndtn_scaled(:,:,:,:) real(kind=dbl_kind), pointer :: fhocn_ptr(:), fresh_ptr(:), um_icenth(:), um_icesth(:) real (kind=dbl_kind) :: hs1, hi1, Tmlt1, ki, rnslyr, rnilyr, licefw, liceht character(len=*),parameter :: subname = 'ice_export_access' @@ -2064,21 +2065,31 @@ subroutine ice_export_access(importState, exportState, ailohi, cpl_dt, rc) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=u_FILE_u, line=__LINE__) - ! Create a temporary field + ! Create temporary fields allocate(tempfld(nx_block,ny_block,nblocks)) allocate(tempfld1(nx_block,ny_block,nblocks)) - + allocate(pndfn_scaled(nx_block,ny_block,ncat,nblocks)) + allocate(pndtn_scaled(nx_block,ny_block,ncat,nblocks)) do n = 1, ncat call state_setexport(exportState, 'ia_aicen', input=aicen , lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) call state_setexport(exportState, 'ia_snown', input=vsnon , lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) call state_setexport(exportState, 'ia_thikn', input=vicen , lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) - ! call state_setexport(exportState, 'ia_pndfn', input=apeffn, lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) - ! call state_setexport(exportState, 'ia_pndtn', input=trcrn(:,:,nt_hpnd,:,:), lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) end do call state_setexport(exportState, 'sstfrz', input=Tf , lmask=tmask, ifrac=ailohi, rc=rc) + ! To conserve pond areas, scale by ice fractions before mapping. Unscale in the atmosphere after mapping + pndfn_scaled(:,:,:,:) = apeffn(:,:,:,:) * aicen(:,:,:,:) + ! To conserve pond volumes, scale by the pond gridcell fraction before mapping. Unscale in the atmosphere + ! after mapping + pndtn_scaled(:,:,:,:) = trcrn(:,:,nt_hpnd,:,:) * apeffn(:,:,:,:) * aicen(:,:,:,:) + + do n = 1, ncat + call state_setexport(exportState, 'ia_pndfn', input=pndfn_scaled, lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) + call state_setexport(exportState, 'ia_pndtn', input=pndtn_scaled, lmask=tmask, ifrac=ailohi, rc=rc, index=n, ungridded_index=n) + end do + rnslyr = real(nslyr,kind=dbl_kind) rnilyr = real(nilyr,kind=dbl_kind)