Skip to content

Commit

Permalink
Merge branch 'dev/master' into user/nnz/fix_restart_issue42
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA committed Aug 31, 2016
2 parents 81ba1ed + 23d7cb6 commit 39eb2ff
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 41 deletions.
10 changes: 5 additions & 5 deletions SIS_fast_thermo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ subroutine sum_top_quantities (FIA, ABT, flux_u, flux_v, flux_t, flux_q, &
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,flux_u,flux_v,flux_t, &
!$OMP flux_q,flux_sw_nir_dir,flux_sw_nir_dif, &
!$OMP flux_sw_vis_dir,flux_sw_vis_dif,flux_lw, &
!$OMP lprec,fprec,flux_lh)
!$OMP lprec,fprec,flux_lh,FIA)
do j=jsc,jec ; do k=0,ncat ; do i=isc,iec
FIA%flux_u_top(i,j,k) = FIA%flux_u_top(i,j,k) + flux_u(i,j,k)
FIA%flux_v_top(i,j,k) = FIA%flux_v_top(i,j,k) + flux_v(i,j,k)
Expand Down Expand Up @@ -192,7 +192,7 @@ subroutine avg_top_quantities(FIA, part_size, G, IG)
sign = 1.0 ; if (FIA%atmos_winds) sign = -1.0
divid = 1.0/real(FIA%avg_count)

!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,sign,divid,G) private(u,v)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,sign,divid,G,FIA) private(u,v)
do j=jsc,jec
do k=0,ncat ; do i=isc,iec
u = FIA%flux_u_top(i,j,k) * (sign*divid)
Expand Down Expand Up @@ -225,7 +225,7 @@ subroutine avg_top_quantities(FIA, part_size, G, IG)
! across all the ice thickness categories on an A-grid. This is done
! over the entire data domain for safety.
FIA%WindStr_x(:,:) = 0.0 ; FIA%WindStr_y(:,:) = 0.0 ; FIA%ice_cover(:,:) = 0.0
!$OMP parallel do default(none) shared(isd,ied,jsd,jed,ncat,FIA) &
!$OMP parallel do default(none) shared(isd,ied,jsd,jed,ncat,FIA,part_size) &
!$OMP private(I_wts)
do j=jsd,jed
do k=1,ncat ; do i=isd,ied
Expand Down Expand Up @@ -334,7 +334,7 @@ subroutine do_update_ice_model_fast( Atmos_boundary, IST, OSS, FIA, CS, G, IG )
call IST_chksum("Start do_update_ice_model_fast", IST, G, IG)

!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,Atmos_boundary,i_off, &
!$OMP j_off,Ice,flux_u,flux_v,flux_t,flux_q,flux_lw, &
!$OMP j_off,flux_u,flux_v,flux_t,flux_q,flux_lw, &
!$OMP flux_sw_nir_dir,flux_sw_nir_dif, &
!$OMP flux_sw_vis_dir,flux_sw_vis_dif, &
!$OMP lprec,fprec,dhdt,dedt,drdt ) &
Expand Down Expand Up @@ -380,7 +380,7 @@ subroutine do_update_ice_model_fast( Atmos_boundary, IST, OSS, FIA, CS, G, IG )
!$OMP flux_sw_vis_dir,flux_sw_vis_dif,flux_sw_nir_dir, &
!$OMP flux_sw_nir_dif,flux_t,flux_q,flux_lw,enth_liq_0,&
!$OMP dt_fast,flux_lh,I_enth_unit,G,S_col,kg_H_Nk, &
!$OMP enth_units,LatHtFus,LatHtVap,IG) &
!$OMP enth_units,LatHtFus,LatHtVap,IG,OSS,FIA,CS) &
!$OMP private(T_Freeze_surf,latent,enth_col,flux_sw,dhf_dt, &
!$OMP hf_0,ts_new,dts,SW_abs_col,SW_absorbed,enth_here,&
!$OMP tot_heat_in,enth_imb,norm_enth_imb )
Expand Down
8 changes: 4 additions & 4 deletions SIS_slow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I
endif
!$OMP parallel do default(none) shared(isd,ied,jsd,jed,WindStr_x_A,WindStr_y_A, &
!$OMP ice_cover,ice_free,WindStr_x_ocn_A, &
!$OMP WindStr_y_ocn_A)
!$OMP WindStr_y_ocn_A,FIA)
do j=jsd,jed
do i=isd,ied
WindStr_x_ocn_A(i,j) = FIA%flux_u_top(i,j,0)
Expand Down Expand Up @@ -573,7 +573,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I
call enable_SIS_averaging(dt_slow, CS%Time, CS%diag)

! Set appropriate surface quantities in categories with no ice. Change <1e-10 to == 0?
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,OSS)
do j=jsc,jec ; do k=1,ncat ; do i=isc,iec ; if (IST%part_size(i,j,k)<1e-10) &
IST%t_surf(i,j,k) = T_0degC + T_Freeze(OSS%s_surf(i,j),IST%ITV)
enddo ; enddo ; enddo
Expand Down Expand Up @@ -802,7 +802,7 @@ subroutine set_ocean_top_stress_Bgrid(IOF, windstr_x_water, windstr_y_water, &

! Copy and interpolate the ice-ocean stress_Bgrid. This code is slightly
! complicated because there are 3 different staggering options supported.
!$OMP parallel default(none) shared(isc,iec,jsc,jec,ncat,G, &
!$OMP parallel default(none) shared(isc,iec,jsc,jec,ncat,G,IOF, &
!$OMP part_size,windstr_x_water,windstr_y_water, &
!$OMP str_ice_oce_x,str_ice_oce_y) &
!$OMP private(ps_vel)
Expand Down Expand Up @@ -905,7 +905,7 @@ subroutine set_ocean_top_stress_Cgrid(IOF, windstr_x_water, windstr_y_water, &

! Copy and interpolate the ice-ocean stress_Cgrid. This code is slightly
! complicated because there are 3 different staggering options supported.
!$OMP parallel default(none) shared(isc,iec,jsc,jec,ncat,G, &
!$OMP parallel default(none) shared(isc,iec,jsc,jec,ncat,G,IOF, &
!$OMP part_size,windstr_x_water,windstr_y_water, &
!$OMP str_ice_oce_x,str_ice_oce_y) &
!$OMP private(ps_vel)
Expand Down
27 changes: 14 additions & 13 deletions SIS_slow_thermo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ subroutine post_flux_diagnostics(IST, FIA, IOF, CS, G, IG, Idt_slow)
if (FIA%id_evap>0) call post_avg(FIA%id_evap, FIA%flux_q_top, IST%part_size, &
CS%diag, G=G)
if (FIA%id_sw>0) then
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST,FIA)
do j=jsc,jec
do i=isc,iec ; tmp2d(i,j) = 0.0 ; enddo
do k=0,ncat ; do i=isc,iec
Expand All @@ -144,7 +144,7 @@ subroutine post_flux_diagnostics(IST, FIA, IOF, CS, G, IG, Idt_slow)
if (FIA%id_rain>0) call post_avg(FIA%id_rain, FIA%lprec_top, &
IST%part_size, CS%diag, G=G)
if (FIA%id_sw_vis>0) then
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST,FIA)
do j=jsc,jec
do i=isc,iec ; tmp2d(i,j) = 0.0 ; enddo
do k=0,ncat ; do i=isc,iec
Expand All @@ -155,7 +155,7 @@ subroutine post_flux_diagnostics(IST, FIA, IOF, CS, G, IG, Idt_slow)
call post_data(FIA%id_sw_vis, tmp2d, CS%diag)
endif
if (FIA%id_sw_dir>0) then
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST,FIA)
do j=jsc,jec
do i=isc,iec ; tmp2d(i,j) = 0.0 ; enddo
do k=0,ncat ; do i=isc,iec
Expand All @@ -166,7 +166,7 @@ subroutine post_flux_diagnostics(IST, FIA, IOF, CS, G, IG, Idt_slow)
call post_data(FIA%id_sw_dir, tmp2d, CS%diag)
endif
if (FIA%id_sw_dif>0) then
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,tmp2d,IST,FIA)
do j=jsc,jec
do i=isc,iec ; tmp2d(i,j) = 0.0 ; enddo
do k=0,ncat ; do i=isc,iec
Expand Down Expand Up @@ -277,7 +277,7 @@ subroutine slow_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
call disable_SIS_averaging(CS%diag)

call accumulate_input_2(IST, FIA, IOF, IST%part_size, dt_slow, G, IG, CS%sum_output_CSp)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,IST)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,IOF)
do j=jsc,jec ; do i=isc,iec
IOF%Enth_Mass_in_atm(i,j) = 0.0 ; IOF%Enth_Mass_out_atm(i,j) = 0.0
IOF%Enth_Mass_in_ocn(i,j) = 0.0 ; IOF%Enth_Mass_out_ocn(i,j) = 0.0
Expand Down Expand Up @@ -514,7 +514,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
enth_prev(:,:,:) = 0.0 ; heat_in(:,:,:) = 0.0
enth_prev_col(:,:) = 0.0 ; heat_in_col(:,:) = 0.0 ; enth_mass_in_col(:,:) = 0.0
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,enth_prev,G,I_Nk, &
!$OMP heat_in_col,dt_slow,enth_prev_col,NkIce)
!$OMP heat_in_col,dt_slow,enth_prev_col,NkIce,FIA)
do j=jsc,jec
do k=1,ncat ; do i=isc,iec ; if (IST%mH_ice(i,j,k) > 0.0) then
enth_prev(i,j,k) = IST%mH_snow(i,j,k) * IST%enth_snow(i,j,k,1)
Expand Down Expand Up @@ -553,7 +553,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
salt_change(:,:) = 0.0
h2o_change(:,:) = 0.0
!$OMP parallel default(none) shared(isc,iec,jsc,jec,ncat,G,IST,salt_change,kg_H_Nk, &
!$OMP h2o_change,NkIce,IG)
!$OMP h2o_change,NkIce,IG,CS,IOF,FIA)
if (CS%ice_rel_salin <= 0.0) then
!$OMP do
do j=jsc,jec ; do m=1,NkIce ; do k=1,ncat ; do i=isc,iec
Expand Down Expand Up @@ -614,7 +614,8 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,G,IST,S_col0,NkIce,S_col, &
!$OMP dt_slow,snow_to_ice,heat_in,I_NK,enth_units, &
!$OMP enth_prev,enth_mass_in_col,Idt_slow,bsnk, &
!$OMP salt_change,net_melt,kg_H_nk,LatHtFus,LatHtVap,IG) &
!$OMP salt_change,net_melt,kg_H_nk,LatHtFus,LatHtVap,&
!$OMP IG,CS,OSS,FIA,IOF) &
!$OMP private(mass_prev,enthalpy,enthalpy_ocean,Salin, &
!$OMP heat_to_ocn,h2o_ice_to_ocn,h2o_ocn_to_ice, &
!$OMP evap_from_ocn,salt_to_ice,bablt,enth_evap, &
Expand Down Expand Up @@ -744,7 +745,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,G,IG,IST,S_col0,NkIce,S_col, &
!$OMP dt_slow,snow_to_ice,heat_in,I_NK,enth_units, &
!$OMP enth_prev,enth_mass_in_col,Idt_slow,bsnk, &
!$OMP salt_change,net_melt,kg_h_Nk,LatHtFus) &
!$OMP salt_change,net_melt,kg_h_Nk,LatHtFus,FIA,CS,OSS,IOF) &
!$OMP private(mass_prev,enthalpy,enthalpy_ocean,Salin, &
!$OMP heat_to_ocn,h2o_ice_to_ocn,h2o_ocn_to_ice, &
!$OMP evap_from_ocn,salt_to_ice,bablt,enth_evap, &
Expand Down Expand Up @@ -902,7 +903,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,NkIce,IST,G,I_enth_units, &
!$OMP spec_thermo_sal,kg_H_Nk,S_col,Obs_h_ice,dt_slow, &
!$OMP Obs_cn_ice,snow_to_ice,salt_change,qflx_lim_ice, &
!$OMP Idt_slow,net_melt,IG) &
!$OMP Idt_slow,net_melt,IG,CS,IOF,FIA) &
!$OMP private(mtot_ice,frac_keep,frac_melt,salt_to_ice, &
!$OMP h2o_ice_to_ocn,enth_to_melt,enth_ice_to_ocn, &
!$OMP ice_melt_lay,snow_melt,enth_freeze)
Expand Down Expand Up @@ -955,7 +956,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
if (CS%column_check) then
enth_col(:,:) = 0.0
! Add back any frazil that has not been used yet.
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,heat_in_col,IST,dt_slow)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,heat_in_col,IST,dt_slow,FIA,IOF)
do j=jsc,jec ; do i=isc,iec
heat_in_col(i,j) = heat_in_col(i,j) + FIA%frazil_left(i,j) + IOF%flux_t_ocn_top(i,j)*dt_slow
enddo ; enddo
Expand All @@ -969,7 +970,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
enddo
endif ; enddo ; enddo ; enddo
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,enth_col,IST,enth_units, &
!$OMP heat_in_col,enth_mass_in_col,enth_prev_col) &
!$OMP heat_in_col,enth_mass_in_col,enth_prev_col,IOF,CS) &
!$OMP private(enth_here,tot_heat_in,emic2,tot_heat_in2, &
!$OMP enth_imb,norm_enth_imb,enth_imb2)
do j=jsc,jec ; do i=isc,iec
Expand Down Expand Up @@ -1004,7 +1005,7 @@ subroutine SIS2_thermodynamics(IST, dt_slow, CS, OSS, FIA, IOF, G, IG)
enddo ; enddo ; enddo ; enddo
endif
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,G,h2o_change, &
!$OMP salt_change,Idt_slow,IG) &
!$OMP salt_change,Idt_slow,IG,IOF)
do j=jsc,jec
do k=1,ncat ; do i=isc,iec
h2o_change(i,j) = h2o_change(i,j) + IST%part_size(i,j,k) * &
Expand Down
6 changes: 3 additions & 3 deletions SIS_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ subroutine accumulate_input_1(IST, FIA, dt, G, IG, CS)

FW_in(:,:) = 0.0 ; salt_in(:,:) = 0.0 ; heat_in(:,:) = 0.0

!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,CS,enth_units,dt) &
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,CS,enth_units,dt,FIA) &
!$OMP private(area_pt,Flux_SW)
do j=jsc,jec ; do k=1,ncat ; do i=isc,iec
area_pt = IST%part_size(i,j,k)
Expand Down Expand Up @@ -829,7 +829,7 @@ subroutine accumulate_input_2(IST, FIA, IOF, part_size, dt, G, IG, CS)
! as these are not yet known.

call get_SIS2_thermo_coefs(IST%ITV, enthalpy_units=enth_units, Latent_fusion=LI)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,i_off,j_off,CS,dt,Ice,IST,&
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,CS,dt,IST,FIA,IOF,&
!$OMP enth_units, LI) &
!$OMP private(area_pt)
do j=jsc,jec ; do i=isc,iec
Expand All @@ -849,7 +849,7 @@ subroutine accumulate_input_2(IST, FIA, IOF, part_size, dt, G, IG, CS)

! The terms that are added here include surface fluxes that will be passed
! directly on into the ocean.
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,part_size,IST,CS,dt,enth_units)&
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,part_size,IST,CS,dt,enth_units,FIA)&
!$OMP private(area_pt,pen_frac,Flux_SW)
do j=jsc,jec ; do k=0,ncat ; do i=isc,iec
area_pt = part_size(i,j,k)
Expand Down
Loading

0 comments on commit 39eb2ff

Please sign in to comment.