Surface buoyancy (heat and fresh water) fluxes for the dumbbell test case.
51 type(surface),
intent(inout) :: state
53 type(forcing),
intent(inout) :: fluxes
56 type(time_type),
intent(in) :: day
57 real,
intent(in) :: dt
59 type(ocean_grid_type),
intent(in) :: G
60 type(dumbbell_surface_forcing_CS),
pointer :: CS
65 real :: density_restore
68 integer :: i, j, is, ie, js, je
69 integer :: isd, ied, jsd, jed
71 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
72 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
76 if (cs%use_temperature)
then
77 call safe_alloc_ptr(fluxes%evap, isd, ied, jsd, jed)
78 call safe_alloc_ptr(fluxes%lprec, isd, ied, jsd, jed)
79 call safe_alloc_ptr(fluxes%fprec, isd, ied, jsd, jed)
80 call safe_alloc_ptr(fluxes%lrunoff, isd, ied, jsd, jed)
81 call safe_alloc_ptr(fluxes%frunoff, isd, ied, jsd, jed)
82 call safe_alloc_ptr(fluxes%vprec, isd, ied, jsd, jed)
84 call safe_alloc_ptr(fluxes%sw, isd, ied, jsd, jed)
85 call safe_alloc_ptr(fluxes%lw, isd, ied, jsd, jed)
86 call safe_alloc_ptr(fluxes%latent, isd, ied, jsd, jed)
87 call safe_alloc_ptr(fluxes%sens, isd, ied, jsd, jed)
89 call safe_alloc_ptr(fluxes%buoy, isd, ied, jsd, jed)
95 if ( cs%use_temperature )
then
98 do j=js,je ;
do i=is,ie
101 fluxes%evap(i,j) = -0.0 * g%mask2dT(i,j)
102 fluxes%lprec(i,j) = 0.0 * g%mask2dT(i,j)
105 fluxes%vprec(i,j) = 0.0
108 fluxes%lw(i,j) = 0.0 * g%mask2dT(i,j)
109 fluxes%latent(i,j) = 0.0 * g%mask2dT(i,j)
110 fluxes%sens(i,j) = 0.0 * g%mask2dT(i,j)
111 fluxes%sw(i,j) = 0.0 * g%mask2dT(i,j)
114 do j=js,je ;
do i=is,ie
117 fluxes%buoy(i,j) = 0.0 * g%mask2dT(i,j)
121 if (cs%use_temperature .and. cs%restorebuoy)
then
122 do j=js,je ;
do i=is,ie
125 if (cs%forcing_mask(i,j)>0.)
then
126 fluxes%vprec(i,j) = - (g%mask2dT(i,j) * (cs%Rho0*cs%Flux_const)) * &
127 ((cs%S_restore(i,j) - state%SSS(i,j)) / &
128 (0.5 * (cs%S_restore(i,j) + state%SSS(i,j))))