-
Notifications
You must be signed in to change notification settings - Fork 3
moving nest physics and type changes #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
22478e6
c5e7f6f
c047464
7ae9299
4663d3c
9c229f7
1e8e1b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -529,11 +529,22 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop | |
| integer :: is, ie, js, je | ||
| integer :: this_pe | ||
| integer :: nb, blen, i, j ,k, ix, nv, im | ||
| integer :: isnow | ||
|
|
||
| real(kind=kind_phys) :: dzs(1:4) | ||
| real(kind=kind_phys) :: porosity(1:19) | ||
|
|
||
|
|
||
| type(fv_moving_nest_physics_type), pointer :: mn_phys | ||
|
|
||
| this_pe = mpp_pe() | ||
| mn_phys => Moving_nest(n)%mn_phys | ||
|
|
||
| dzs = (/0.1,0.3,0.6,1.0/) ! 4 layer soil thickness | ||
| porosity = (/0.339,0.421,0.434,0.476,0.484,0.439,0.404,0.464, & | ||
| 0.465,0.406,0.468,0.468,0.439,1.000,0.200,0.421, & | ||
| 0.468,0.200,0.339/) | ||
|
|
||
| ! Needed to fill the local grids for parent and nest PEs in order to transmit/interpolate data from parent to nest | ||
| ! But only the nest PE's have changed the values with nest motion, so they are the only ones that need to update the original arrays | ||
| if (is_fine_pe) then | ||
|
|
@@ -705,8 +716,7 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop | |
|
|
||
| if (GFS_control%lsm == GFS_control%lsm_noahmp) then | ||
|
|
||
| GFS_sfcprop%scolor(im) = mn_phys%soilcolor(i,j) | ||
| GFS_sfcprop%snowxy(im) = mn_phys%snowxy(i,j) | ||
| GFS_sfcprop%scolor(im) = mn_phys%soilcolor(i,j) | ||
| GFS_sfcprop%tvxy(im) = mn_phys%tvxy(i,j) | ||
| GFS_sfcprop%tgxy(im) = mn_phys%tgxy(i,j) | ||
| GFS_sfcprop%canicexy(im) = mn_phys%canicexy(i,j) | ||
|
|
@@ -735,26 +745,115 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop | |
| GFS_sfcprop%smcwtdxy(im) = mn_phys%smcwtdxy(i,j) | ||
| GFS_sfcprop%deeprechxy(im) = mn_phys%deeprechxy(i,j) | ||
| GFS_sfcprop%rechxy(im) = mn_phys%rechxy(i,j) | ||
| GFS_sfcprop%snowxy(im) = mn_phys%snowxy(i,j) | ||
|
|
||
| do k = 1, GFS_control%lsoil | ||
| GFS_sfcprop%smoiseq(im,k) = mn_phys%smoiseq(i,j,k) | ||
| enddo | ||
|
|
||
| isnow = nint(GFS_sfcprop%snowxy(im)) + 1 | ||
|
|
||
| do k = GFS_control%lsnow_lsm_lbound, GFS_control%lsnow_lsm_ubound | ||
| GFS_sfcprop%snicexy(im,k) = mn_phys%snicexy(i,j,k) | ||
| GFS_sfcprop%snliqxy(im,k) = mn_phys%snliqxy(i,j,k) | ||
| GFS_sfcprop%tsnoxy(im,k) = mn_phys%tsnoxy(i,j,k) | ||
| do k = isnow, 0 | ||
| GFS_sfcprop%tsnoxy(im,k) = mn_phys%tsnoxy(i,j,k) | ||
| GFS_sfcprop%snicexy(im,k) = mn_phys%snicexy(i,j,k) | ||
| GFS_sfcprop%snliqxy(im,k) = mn_phys%snliqxy(i,j,k) | ||
| enddo | ||
|
|
||
| GFS_sfcprop%snowd(im) = mn_phys%snowd(i,j) | ||
| GFS_sfcprop%weasd(im) = mn_phys%weasd(i,j) | ||
| do k = isnow, GFS_control%lsoil | ||
| GFS_sfcprop%zsnsoxy(im,k) = mn_phys%zsnsoxy(i,j,k) | ||
| enddo | ||
|
|
||
|
|
||
| ! soil moisture check against uplimit porosity when Noah MP LSM is used | ||
|
|
||
| do k = GFS_control%lsnow_lsm_lbound, GFS_control%lsoil | ||
| GFS_sfcprop%zsnsoxy(im,k) = mn_phys%zsnsoxy(i,j,k) | ||
| do k = 1, GFS_control%lsoil | ||
| GFS_sfcprop%smc(im,k) = min(GFS_sfcprop%smc(im,k),porosity(GFS_sfcprop%stype(im))-0.01) | ||
| GFS_sfcprop%slc(im,k) = min(GFS_sfcprop%slc(im,k),porosity(GFS_sfcprop%stype(im))-0.01) | ||
| enddo | ||
|
|
||
| ! use snowd and weasd to set snow related variables, and set soil related quantities over land ice | ||
| ! (snowd is set to 2 meters and weasd is 600 mm), snow layers may be different around a new land point. | ||
| ! can't do average, the nearest point method is not spported yet. | ||
| ! check to see if smoiseq needs to be set. | ||
|
|
||
| GFS_sfcprop%snowd(im) = mn_phys%snowd(i,j) | ||
| GFS_sfcprop%weasd(im) = mn_phys%weasd(i,j) | ||
|
|
||
| if (int(GFS_sfcprop%vtype(im)) == 15) then ! set stc,smc,slc over glaceir ice | ||
| do k = 1,GFS_control%lsoil | ||
| GFS_sfcprop%stc(im,k) = min(mn_phys%stc(i,j,k),min(GFS_Sfcprop%tg3(im),263.15)) | ||
| GFS_sfcprop%smc(im,k) = 1.0 | ||
| GFS_sfcprop%slc(im,k) = 0.0 | ||
| enddo | ||
| GFS_sfcprop%weasd(im) = 600.0 ! 600mm SWE for glacier | ||
| GFS_sfcprop%snowd(im) = 2000.0 ! 2m snow depth for glacier, snowd/snwdph is in mm | ||
| endif | ||
|
|
||
| if (GFS_sfcprop%snowd(im) == 0.0 .and. GFS_sfcprop%weasd(im) /= 0.0 ) then ! use weasd to set snowd, in case | ||
| GFS_sfcprop%snowd(im) = GFS_sfcprop%weasd(im)/10.0 !snowd is snwdph in mm. divide by 10. | ||
| endif | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to do this for all grids? this seems like it will reset all the snow layering even for grids that were not created during the move |
||
| if (mn_phys%leading_edge(i,j)) then ! reset Noah MP snow fields on new land points only | ||
|
|
||
| if (GFS_sfcprop%snowd(im)/1000.0 < 0.025) then | ||
| GFS_sfcprop%snowxy(im) = 0 | ||
| GFS_sfcprop%dzsno(-2:0) = 0.0 | ||
| elseif (GFS_sfcprop%snowd(im)/1000.0 >= 0.025 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.05 ) then | ||
| GFS_sfcprop%snowxy(im) = -1.0 | ||
| GFS_sfcprop%dzsno(0) = GFS_sfcprop%snowd(im)/1000.0 | ||
| elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.05 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.10 ) then | ||
| GFS_sfcprop%snowxy(im) = -2.0 | ||
| GFS_sfcprop%dzsno(-1) = 0.5*GFS_sfcprop%snowd(im)/1000.0 | ||
| GFS_sfcprop%dzsno(0) = 0.5*GFS_sfcprop%snowd(im)/1000.0 | ||
| elseif (GFS_sfcprop%snowd(im) /1000.0> 0.10 .and. GFS_sfcprop%snowd(im) /1000.0<= 0.25 ) then | ||
| GFS_sfcprop%snowxy(im) = -2.0 | ||
| GFS_sfcprop%dzsno(-1) = 0.05 | ||
| GFS_sfcprop%dzsno(0) = GFS_sfcprop%snowd(im)/1000.0- 0.05 | ||
| elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.25 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.45 ) then | ||
| GFS_sfcprop%snowxy(im) = -3.0 | ||
| GFS_sfcprop%dzsno(-2) = 0.05 | ||
| GFS_sfcprop%dzsno(-1) = 0.5*(GFS_sfcprop%snowd(im)/1000.0-0.05) | ||
| GFS_sfcprop%dzsno(0) = 0.5*(GFS_sfcprop%snowd(im)/1000.0-0.05) | ||
| elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.45) then | ||
| GFS_sfcprop%snowxy(im) = -3.0 | ||
| GFS_sfcprop%dzsno(-2) = 0.05 | ||
| GFS_sfcprop%dzsno(-1) = 0.20 | ||
| GFS_sfcprop%dzsno(0) = GFS_sfcprop%snowd(im)/1000.0 - 0.05 - 0.20 | ||
| else | ||
| write(*,*) 'Error in fv_moving_nest_physics.F90 Problem with the logic assigning snow layers ' | ||
| stop | ||
|
|
||
| endif | ||
|
|
||
| isnow = nint(GFS_sfcprop%snowxy(im)) + 1 ! new snow layers at new land points | ||
|
|
||
| do k = isnow, 0 | ||
|
|
||
| GFS_sfcprop%tsnoxy(im,k) = GFS_sfcprop%tgxy(im) + (( sum(GFS_sfcprop%dzsno(isnow:k)) - \ | ||
| 0.5*GFS_sfcprop%dzsno(k) )/ GFS_sfcprop%snowd(im)/1000.0)*( GFS_sfcprop%stc(im,1)- GFS_sfcprop%tgxy(im)) | ||
|
|
||
| GFS_sfcprop%snliqxy(im,k) = 0.0 | ||
| GFS_sfcprop%snicexy(im,k) = 1.0 * GFS_sfcprop%dzsno(k) * GFS_sfcprop%weasd(im)/GFS_sfcprop%snowd(im) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this going to be overwritten by the lines below?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. These lines are from the old code and should be removed (including the line for GFS_sfcprop%zsnsoxy (im,k)= mn_phys%zsnsoxy(i,j,k) ). |
||
|
|
||
| enddo | ||
|
|
||
|
|
||
| do k = isnow, 0 | ||
| GFS_sfcprop%dzsnso(k) = -GFS_sfcprop%dzsno(k) | ||
| enddo | ||
|
|
||
| do k = 1, 4 | ||
| GFS_sfcprop%dzsnso(k) = -dzs(k) | ||
| enddo | ||
|
|
||
| GFS_sfcprop%zsnsoxy(im,isnow) = GFS_sfcprop%dzsnso(isnow) | ||
|
|
||
| do k = isnow + 1, GFS_control%lsoil | ||
| GFS_sfcprop%zsnsoxy(im, k) = GFS_sfcprop%zsnsoxy(im,k-1) + GFS_sfcprop%dzsnso(k) | ||
| enddo | ||
|
|
||
| endif | ||
| endif | ||
|
|
||
| ! Check if stype and vtype are properly set for land points. Set to reasonable values if they have fill values. | ||
| if ( (int(GFS_sfcprop%slmsk(im)) .eq. 1) ) then | ||
|
|
@@ -775,8 +874,10 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop | |
| endif | ||
|
|
||
| endif | ||
|
|
||
| enddo | ||
| enddo | ||
|
|
||
| endif | ||
|
|
||
| end subroutine mn_phys_apply_temp_variables | ||
|
|
@@ -1643,8 +1744,6 @@ subroutine mn_phys_shift_data(Atm, GFS_control, n, child_grid_num, wt_h, wt_u, w | |
| delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) | ||
| call mn_var_shift_data(mn_phys%smoiseq, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & | ||
| delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, GFS_control%lsoil) | ||
|
|
||
|
|
||
| call mn_var_shift_data(mn_phys%snicexy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & | ||
| delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, GFS_control%lsnow_lsm_lbound, GFS_control%lsnow_lsm_ubound) | ||
| call mn_var_shift_data(mn_phys%snliqxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.