Skip to content

Commit

Permalink
Add additional land-ice coulping fields. #155
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Apr 16, 2020
1 parent b19a09e commit 3bbef26
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bld/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if ( $AusCOM == 'yes' ) then
setenv CPLLIBDIR $LIBACCESSOM2_ROOT/build/lib
setenv CPLLIBS '-L$(CPLLIBDIR)/ -laccessom2'
setenv CPLINCDIR $LIBACCESSOM2_ROOT/build
setenv OASISDIR $CPLINCDIR/oasis3-mct-prefix/src/oasis3-mct/Linux/build/lib/
setenv OASISDIR $LIBACCESSOM2_ROOT/oasis3-mct/Linux/build/lib/
setenv CPL_INCS '-I$(CPLINCDIR)/include -I$(OASISDIR)/psmile.MPI1 -I$(OASISDIR)/mct'
endif
Expand Down
15 changes: 10 additions & 5 deletions drivers/auscom/cpl_arrays_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ module cpl_arrays_setup
!
!(14) ice melt waterflux iomelt
!(15) ice form waterflux ioform
!(16) land ice waterflux iolicefw
!(17) land ice heatflux iolicefh
!
!
! 17 in, 16 out => thus we set jpfldout=16, jpfldin=17 (in cpl_parameters)!
! 18 in, 18 out => thus we set jpfldout=18, jpfldin=18 (in cpl_parameters)!
!
!----------------------------------------------------------------------------
!Note:
Expand All @@ -81,14 +83,17 @@ module cpl_arrays_setup
! Fields in
real(kind=dbl_kind), dimension(:,:,:), allocatable :: & !from atm
tair0, swflx0, lwflx0, uwnd0, vwnd0, qair0, rain0, snow0 & !(for ice)
,runof0, press0 !(for ocn)
,runof0, press0, calv0 !(for ocn)

real(kind=dbl_kind), dimension(:,:,:), allocatable :: runof, press

! CORE runoff remapped onto the AusCOM grid
real(kind=dbl_kind), dimension(:,:,:), allocatable :: &
core_runoff

real(kind=dbl_kind), dimension(:,:,:), allocatable :: &
icecalve_runoff


real(kind=dbl_kind), dimension(:,:,:), allocatable :: & !from ocn
ssto, ssso, ssuo, ssvo, sslx, ssly, pfmice
real(kind=dbl_kind), dimension(:,:), allocatable :: gwork
Expand All @@ -98,11 +103,11 @@ module cpl_arrays_setup
real(kind=dbl_kind),dimension(:,:,:), allocatable :: & !to ocn (time averaged)
iostrsu, iostrsv, iorain, iosnow, iostflx, iohtflx, ioswflx &
,ioqflux, ioshflx, iolwflx, iorunof, iopress, ioaice &
,iomelt, ioform
,iomelt, ioform, iolicefw, iolicefh
real(kind=dbl_kind),dimension(:,:,:), allocatable :: & !to ocn (temporary)
tiostrsu, tiostrsv, tiorain, tiosnow, tiostflx, tiohtflx, tioswflx &
,tioqflux, tioshflx, tiolwflx, tiorunof, tiopress, tioaice &
,tiomelt, tioform
,tiomelt, tioform, tiolicefw, tiolicefh

! other stuff
real(kind=dbl_kind),dimension(:,:,:), allocatable :: &
Expand Down
4 changes: 4 additions & 0 deletions drivers/auscom/cpl_forcing_handler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ subroutine nullify_i2o_fluxes()
ioaice(:,:,:) = 0.0
iomelt(:,:,:) = 0.0
ioform(:,:,:) = 0.0
iolicefw(:,:,:) = 0.0
iolicefh(:,:,:) = 0.0

end subroutine nullify_i2o_fluxes

Expand All @@ -67,6 +69,8 @@ subroutine tavg_i2o_fluxes
!!!
iomelt (:,:,:) = iomelt (:,:,:) + tiomelt (:,:,:)*coef_ic
ioform (:,:,:) = ioform (:,:,:) + tioform (:,:,:)*coef_ic
iolicefw (:,:,:) = iolicefw (:,:,:) + tiolicefw (:,:,:)*coef_ic
iolicefh (:,:,:) = iolicefh (:,:,:) + tiolicefh (:,:,:)*coef_ic

return
end subroutine tavg_i2o_fluxes
Expand Down
14 changes: 14 additions & 0 deletions drivers/auscom/cpl_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
cl_writ(n_i2a+13)='aice_io'
cl_writ(n_i2a+14)='melt_io'
cl_writ(n_i2a+15)='form_io'
cl_writ(n_i2a+16)='licefw_io'
cl_writ(n_i2a+17)='licefh_io'

do jf=1, jpfldout
call oasis_def_var(il_var_id_out(jf),cl_writ(jf), part_id, &
Expand All @@ -269,6 +271,7 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
cl_read(8) ='qair_i'
cl_read(9) ='uwnd_i'
cl_read(10)='vwnd_i'
cl_read(11)='licalv_i'
!ocn ==> ice
cl_read(n_a2i+1)='sst_i'
cl_read(n_a2i+2)='sss_i'
Expand Down Expand Up @@ -521,6 +524,9 @@ subroutine from_atm(isteps)
call oasis_get(il_var_id_in(10), isteps, work, info)
call unpack_coupling_array(work, vwnd0)

call oasis_get(il_var_id_in(11), isteps, work, info)
call unpack_coupling_array(work, calv0)

! need do t-grid to u-grid shift for vectors since all coupling occur on
! t-grid points: <==No! actually CICE requires the input wind on T grid!
! (see comment in code ice_flux.F)
Expand Down Expand Up @@ -646,6 +652,12 @@ subroutine into_ocn(isteps, scale)
call pack_coupling_array(ioform*scale, work)
call oasis_put(il_var_id_out(16), isteps, work, ierror)

call pack_coupling_array(iolicefw*scale, work)
call oasis_put(il_var_id_out(17), isteps, work, ierror)

call pack_coupling_array(iolicefh*scale, work)
call oasis_put(il_var_id_out(18), isteps, work, ierror)

if (chk_i2o_fields) then
call check_i2o_fields('fields_i2o_in_ice.nc',isteps, scale)
endif
Expand Down Expand Up @@ -685,6 +697,7 @@ subroutine update_halos_from_atm(time)
call ice_HaloUpdate(qair0, halo_info, field_loc_center, field_type_scalar)
call ice_HaloUpdate(uwnd0, halo_info, field_loc_center, field_type_vector)
call ice_HaloUpdate(vwnd0, halo_info, field_loc_center, field_type_vector)
call ice_HaloUpdate(calv0, halo_info, field_loc_center, field_type_vector)
call ice_timer_stop(timer_from_atm_halos)

end subroutine update_halos_from_atm
Expand Down Expand Up @@ -770,6 +783,7 @@ subroutine write_boundary_checksums(time)
print*, '[ice chksum] qair0:', sum(qair0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] uwnd0:', sum(uwnd0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] vwnd0:', sum(vwnd0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] vwnd0:', sum(calv0(isc:iec, jsc:jec, 1))

print*, '[ice chksum] u_star0:', sum(u_star0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] rough_mom0:', sum(rough_mom0(isc:iec, jsc:jec, 1))
Expand Down

0 comments on commit 3bbef26

Please sign in to comment.