MODULE module_domain USE module_driver_constants USE module_machine USE module_configure USE module_wrf_error USE module_utility USE module_domain_type TYPE(domain) , POINTER :: head_grid , new_grid , next_grid , old_grid TYPE domain_levels TYPE(domain) , POINTER :: first_domain END TYPE domain_levels TYPE(domain_levels) , DIMENSION(max_levels) :: head_for_each_level TYPE(domain), POINTER :: current_grid LOGICAL, SAVE :: current_grid_set = .FALSE. PRIVATE domain_time_test_print PRIVATE test_adjust_io_timestr INTERFACE get_ijk_from_grid MODULE PROCEDURE get_ijk_from_grid1, get_ijk_from_grid2 END INTERFACE INTEGER, PARAMETER :: max_hst_mods = 200 CONTAINS SUBROUTINE adjust_domain_dims_for_move( grid , dx, dy ) IMPLICIT NONE TYPE( domain ), POINTER :: grid INTEGER, INTENT(IN) :: dx, dy data_ordering : SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) grid%sm31 = grid%sm31 + dx grid%em31 = grid%em31 + dx grid%sm32 = grid%sm32 + dy grid%em32 = grid%em32 + dy grid%sp31 = grid%sp31 + dx grid%ep31 = grid%ep31 + dx grid%sp32 = grid%sp32 + dy grid%ep32 = grid%ep32 + dy grid%sd31 = grid%sd31 + dx grid%ed31 = grid%ed31 + dx grid%sd32 = grid%sd32 + dy grid%ed32 = grid%ed32 + dy CASE ( DATA_ORDER_YXZ ) grid%sm31 = grid%sm31 + dy grid%em31 = grid%em31 + dy grid%sm32 = grid%sm32 + dx grid%em32 = grid%em32 + dx grid%sp31 = grid%sp31 + dy grid%ep31 = grid%ep31 + dy grid%sp32 = grid%sp32 + dx grid%ep32 = grid%ep32 + dx grid%sd31 = grid%sd31 + dy grid%ed31 = grid%ed31 + dy grid%sd32 = grid%sd32 + dx grid%ed32 = grid%ed32 + dx CASE ( DATA_ORDER_ZXY ) grid%sm32 = grid%sm32 + dx grid%em32 = grid%em32 + dx grid%sm33 = grid%sm33 + dy grid%em33 = grid%em33 + dy grid%sp32 = grid%sp32 + dx grid%ep32 = grid%ep32 + dx grid%sp33 = grid%sp33 + dy grid%ep33 = grid%ep33 + dy grid%sd32 = grid%sd32 + dx grid%ed32 = grid%ed32 + dx grid%sd33 = grid%sd33 + dy grid%ed33 = grid%ed33 + dy CASE ( DATA_ORDER_ZYX ) grid%sm32 = grid%sm32 + dy grid%em32 = grid%em32 + dy grid%sm33 = grid%sm33 + dx grid%em33 = grid%em33 + dx grid%sp32 = grid%sp32 + dy grid%ep32 = grid%ep32 + dy grid%sp33 = grid%sp33 + dx grid%ep33 = grid%ep33 + dx grid%sd32 = grid%sd32 + dy grid%ed32 = grid%ed32 + dy grid%sd33 = grid%sd33 + dx grid%ed33 = grid%ed33 + dx CASE ( DATA_ORDER_XZY ) grid%sm31 = grid%sm31 + dx grid%em31 = grid%em31 + dx grid%sm33 = grid%sm33 + dy grid%em33 = grid%em33 + dy grid%sp31 = grid%sp31 + dx grid%ep31 = grid%ep31 + dx grid%sp33 = grid%sp33 + dy grid%ep33 = grid%ep33 + dy grid%sd31 = grid%sd31 + dx grid%ed31 = grid%ed31 + dx grid%sd33 = grid%sd33 + dy grid%ed33 = grid%ed33 + dy CASE ( DATA_ORDER_YZX ) grid%sm31 = grid%sm31 + dy grid%em31 = grid%em31 + dy grid%sm33 = grid%sm33 + dx grid%em33 = grid%em33 + dx grid%sp31 = grid%sp31 + dy grid%ep31 = grid%ep31 + dy grid%sp33 = grid%sp33 + dx grid%ep33 = grid%ep33 + dx grid%sd31 = grid%sd31 + dy grid%ed31 = grid%ed31 + dy grid%sd33 = grid%sd33 + dx grid%ed33 = grid%ed33 + dx END SELECT data_ordering RETURN END SUBROUTINE adjust_domain_dims_for_move SUBROUTINE get_ijk_from_grid1 ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey ) IMPLICIT NONE TYPE( domain ), INTENT (IN) :: grid INTEGER, INTENT(OUT) :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey CALL get_ijk_from_grid2 ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe ) data_ordering : SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) imsx = grid%sm31x ; imex = grid%em31x ; jmsx = grid%sm32x ; jmex = grid%em32x ; kmsx = grid%sm33x ; kmex = grid%em33x ; ipsx = grid%sp31x ; ipex = grid%ep31x ; jpsx = grid%sp32x ; jpex = grid%ep32x ; kpsx = grid%sp33x ; kpex = grid%ep33x ; imsy = grid%sm31y ; imey = grid%em31y ; jmsy = grid%sm32y ; jmey = grid%em32y ; kmsy = grid%sm33y ; kmey = grid%em33y ; ipsy = grid%sp31y ; ipey = grid%ep31y ; jpsy = grid%sp32y ; jpey = grid%ep32y ; kpsy = grid%sp33y ; kpey = grid%ep33y ; CASE ( DATA_ORDER_YXZ ) imsx = grid%sm32x ; imex = grid%em32x ; jmsx = grid%sm31x ; jmex = grid%em31x ; kmsx = grid%sm33x ; kmex = grid%em33x ; ipsx = grid%sp32x ; ipex = grid%ep32x ; jpsx = grid%sp31x ; jpex = grid%ep31x ; kpsx = grid%sp33x ; kpex = grid%ep33x ; imsy = grid%sm32y ; imey = grid%em32y ; jmsy = grid%sm31y ; jmey = grid%em31y ; kmsy = grid%sm33y ; kmey = grid%em33y ; ipsy = grid%sp32y ; ipey = grid%ep32y ; jpsy = grid%sp31y ; jpey = grid%ep31y ; kpsy = grid%sp33y ; kpey = grid%ep33y ; CASE ( DATA_ORDER_ZXY ) imsx = grid%sm32x ; imex = grid%em32x ; jmsx = grid%sm33x ; jmex = grid%em33x ; kmsx = grid%sm31x ; kmex = grid%em31x ; ipsx = grid%sp32x ; ipex = grid%ep32x ; jpsx = grid%sp33x ; jpex = grid%ep33x ; kpsx = grid%sp31x ; kpex = grid%ep31x ; imsy = grid%sm32y ; imey = grid%em32y ; jmsy = grid%sm33y ; jmey = grid%em33y ; kmsy = grid%sm31y ; kmey = grid%em31y ; ipsy = grid%sp32y ; ipey = grid%ep32y ; jpsy = grid%sp33y ; jpey = grid%ep33y ; kpsy = grid%sp31y ; kpey = grid%ep31y ; CASE ( DATA_ORDER_ZYX ) imsx = grid%sm33x ; imex = grid%em33x ; jmsx = grid%sm32x ; jmex = grid%em32x ; kmsx = grid%sm31x ; kmex = grid%em31x ; ipsx = grid%sp33x ; ipex = grid%ep33x ; jpsx = grid%sp32x ; jpex = grid%ep32x ; kpsx = grid%sp31x ; kpex = grid%ep31x ; imsy = grid%sm33y ; imey = grid%em33y ; jmsy = grid%sm32y ; jmey = grid%em32y ; kmsy = grid%sm31y ; kmey = grid%em31y ; ipsy = grid%sp33y ; ipey = grid%ep33y ; jpsy = grid%sp32y ; jpey = grid%ep32y ; kpsy = grid%sp31y ; kpey = grid%ep31y ; CASE ( DATA_ORDER_XZY ) imsx = grid%sm31x ; imex = grid%em31x ; jmsx = grid%sm33x ; jmex = grid%em33x ; kmsx = grid%sm32x ; kmex = grid%em32x ; ipsx = grid%sp31x ; ipex = grid%ep31x ; jpsx = grid%sp33x ; jpex = grid%ep33x ; kpsx = grid%sp32x ; kpex = grid%ep32x ; imsy = grid%sm31y ; imey = grid%em31y ; jmsy = grid%sm33y ; jmey = grid%em33y ; kmsy = grid%sm32y ; kmey = grid%em32y ; ipsy = grid%sp31y ; ipey = grid%ep31y ; jpsy = grid%sp33y ; jpey = grid%ep33y ; kpsy = grid%sp32y ; kpey = grid%ep32y ; CASE ( DATA_ORDER_YZX ) imsx = grid%sm33x ; imex = grid%em33x ; jmsx = grid%sm31x ; jmex = grid%em31x ; kmsx = grid%sm32x ; kmex = grid%em32x ; ipsx = grid%sp33x ; ipex = grid%ep33x ; jpsx = grid%sp31x ; jpex = grid%ep31x ; kpsx = grid%sp32x ; kpex = grid%ep32x ; imsy = grid%sm33y ; imey = grid%em33y ; jmsy = grid%sm31y ; jmey = grid%em31y ; kmsy = grid%sm32y ; kmey = grid%em32y ; ipsy = grid%sp33y ; ipey = grid%ep33y ; jpsy = grid%sp31y ; jpey = grid%ep31y ; kpsy = grid%sp32y ; kpey = grid%ep32y ; END SELECT data_ordering END SUBROUTINE get_ijk_from_grid1 SUBROUTINE get_ijk_from_grid2 ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe ) IMPLICIT NONE TYPE( domain ), INTENT (IN) :: grid INTEGER, INTENT(OUT) :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe data_ordering : SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) ids = grid%sd31 ; ide = grid%ed31 ; jds = grid%sd32 ; jde = grid%ed32 ; kds = grid%sd33 ; kde = grid%ed33 ; ims = grid%sm31 ; ime = grid%em31 ; jms = grid%sm32 ; jme = grid%em32 ; kms = grid%sm33 ; kme = grid%em33 ; ips = grid%sp31 ; ipe = grid%ep31 ; jps = grid%sp32 ; jpe = grid%ep32 ; kps = grid%sp33 ; kpe = grid%ep33 ; CASE ( DATA_ORDER_YXZ ) ids = grid%sd32 ; ide = grid%ed32 ; jds = grid%sd31 ; jde = grid%ed31 ; kds = grid%sd33 ; kde = grid%ed33 ; ims = grid%sm32 ; ime = grid%em32 ; jms = grid%sm31 ; jme = grid%em31 ; kms = grid%sm33 ; kme = grid%em33 ; ips = grid%sp32 ; ipe = grid%ep32 ; jps = grid%sp31 ; jpe = grid%ep31 ; kps = grid%sp33 ; kpe = grid%ep33 ; CASE ( DATA_ORDER_ZXY ) ids = grid%sd32 ; ide = grid%ed32 ; jds = grid%sd33 ; jde = grid%ed33 ; kds = grid%sd31 ; kde = grid%ed31 ; ims = grid%sm32 ; ime = grid%em32 ; jms = grid%sm33 ; jme = grid%em33 ; kms = grid%sm31 ; kme = grid%em31 ; ips = grid%sp32 ; ipe = grid%ep32 ; jps = grid%sp33 ; jpe = grid%ep33 ; kps = grid%sp31 ; kpe = grid%ep31 ; CASE ( DATA_ORDER_ZYX ) ids = grid%sd33 ; ide = grid%ed33 ; jds = grid%sd32 ; jde = grid%ed32 ; kds = grid%sd31 ; kde = grid%ed31 ; ims = grid%sm33 ; ime = grid%em33 ; jms = grid%sm32 ; jme = grid%em32 ; kms = grid%sm31 ; kme = grid%em31 ; ips = grid%sp33 ; ipe = grid%ep33 ; jps = grid%sp32 ; jpe = grid%ep32 ; kps = grid%sp31 ; kpe = grid%ep31 ; CASE ( DATA_ORDER_XZY ) ids = grid%sd31 ; ide = grid%ed31 ; jds = grid%sd33 ; jde = grid%ed33 ; kds = grid%sd32 ; kde = grid%ed32 ; ims = grid%sm31 ; ime = grid%em31 ; jms = grid%sm33 ; jme = grid%em33 ; kms = grid%sm32 ; kme = grid%em32 ; ips = grid%sp31 ; ipe = grid%ep31 ; jps = grid%sp33 ; jpe = grid%ep33 ; kps = grid%sp32 ; kpe = grid%ep32 ; CASE ( DATA_ORDER_YZX ) ids = grid%sd33 ; ide = grid%ed33 ; jds = grid%sd31 ; jde = grid%ed31 ; kds = grid%sd32 ; kde = grid%ed32 ; ims = grid%sm33 ; ime = grid%em33 ; jms = grid%sm31 ; jme = grid%em31 ; kms = grid%sm32 ; kme = grid%em32 ; ips = grid%sp33 ; ipe = grid%ep33 ; jps = grid%sp31 ; jpe = grid%ep31 ; kps = grid%sp32 ; kpe = grid%ep32 ; END SELECT data_ordering END SUBROUTINE get_ijk_from_grid2 SUBROUTINE get_ijk_from_subgrid ( grid , & ids0, ide0, jds0, jde0, kds0, kde0, & ims0, ime0, jms0, jme0, kms0, kme0, & ips0, ipe0, jps0, jpe0, kps0, kpe0 ) TYPE( domain ), INTENT (IN) :: grid INTEGER, INTENT(OUT) :: & ids0, ide0, jds0, jde0, kds0, kde0, & ims0, ime0, jms0, jme0, kms0, kme0, & ips0, ipe0, jps0, jpe0, kps0, kpe0 INTEGER :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe CALL get_ijk_from_grid ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe ) ids0 = ids ide0 = ide * grid%sr_x ims0 = (ims-1)*grid%sr_x+1 ime0 = ime * grid%sr_x ips0 = (ips-1)*grid%sr_x+1 ipe0 = ipe * grid%sr_x jds0 = jds jde0 = jde * grid%sr_y jms0 = (jms-1)*grid%sr_y+1 jme0 = jme * grid%sr_y jps0 = (jps-1)*grid%sr_y+1 jpe0 = jpe * grid%sr_y kds0 = kds kde0 = kde kms0 = kms kme0 = kme kps0 = kps kpe0 = kpe RETURN END SUBROUTINE get_ijk_from_subgrid SUBROUTINE wrf_patch_domain( id , domdesc , parent, parent_id , parent_domdesc , & sd1 , ed1 , sp1 , ep1 , sm1 , em1 , & sd2 , ed2 , sp2 , ep2 , sm2 , em2 , & sd3 , ed3 , sp3 , ep3 , sm3 , em3 , & sp1x , ep1x , sm1x , em1x , & sp2x , ep2x , sm2x , em2x , & sp3x , ep3x , sm3x , em3x , & sp1y , ep1y , sm1y , em1y , & sp2y , ep2y , sm2y , em2y , & sp3y , ep3y , sm3y , em3y , & bdx , bdy , bdy_mask ) USE module_machine IMPLICIT NONE LOGICAL, DIMENSION(4), INTENT(OUT) :: bdy_mask INTEGER, INTENT(IN) :: sd1 , ed1 , sd2 , ed2 , sd3 , ed3 , bdx , bdy INTEGER, INTENT(OUT) :: sp1 , ep1 , sp2 , ep2 , sp3 , ep3 , & sm1 , em1 , sm2 , em2 , sm3 , em3 INTEGER, INTENT(OUT) :: sp1x , ep1x , sp2x , ep2x , sp3x , ep3x , & sm1x , em1x , sm2x , em2x , sm3x , em3x INTEGER, INTENT(OUT) :: sp1y , ep1y , sp2y , ep2y , sp3y , ep3y , & sm1y , em1y , sm2y , em2y , sm3y , em3y INTEGER, INTENT(IN) :: id , parent_id , parent_domdesc INTEGER, INTENT(INOUT) :: domdesc TYPE(domain), POINTER :: parent INTEGER spec_bdy_width CALL nl_get_spec_bdy_width( 1, spec_bdy_width ) CALL wrf_dm_patch_domain( id , domdesc , parent_id , parent_domdesc , & sd1 , ed1 , sp1 , ep1 , sm1 , em1 , & sd2 , ed2 , sp2 , ep2 , sm2 , em2 , & sd3 , ed3 , sp3 , ep3 , sm3 , em3 , & sp1x , ep1x , sm1x , em1x , & sp2x , ep2x , sm2x , em2x , & sp3x , ep3x , sm3x , em3x , & sp1y , ep1y , sm1y , em1y , & sp2y , ep2y , sm2y , em2y , & sp3y , ep3y , sm3y , em3y , & bdx , bdy ) SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) bdy_mask( P_XSB ) = ( sd1 <= sp1 .AND. sp1 <= sd1+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd2 <= sp2 .AND. sp2 <= sd2+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed1-spec_bdy_width-1 <= ep1 .AND. ep1 <= ed1 ) bdy_mask( P_YEB ) = ( ed2-spec_bdy_width-1 <= ep2 .AND. ep2 <= ed2 ) CASE ( DATA_ORDER_YXZ ) bdy_mask( P_XSB ) = ( sd2 <= sp2 .AND. sp2 <= sd2+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd1 <= sp1 .AND. sp1 <= sd1+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed2-spec_bdy_width-1 <= ep2 .AND. ep2 <= ed2 ) bdy_mask( P_YEB ) = ( ed1-spec_bdy_width-1 <= ep1 .AND. ep1 <= ed1 ) CASE ( DATA_ORDER_ZXY ) bdy_mask( P_XSB ) = ( sd2 <= sp2 .AND. sp2 <= sd2+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd3 <= sp3 .AND. sp3 <= sd3+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed2-spec_bdy_width-1 <= ep2 .AND. ep2 <= ed2 ) bdy_mask( P_YEB ) = ( ed3-spec_bdy_width-1 <= ep3 .AND. ep3 <= ed3 ) CASE ( DATA_ORDER_ZYX ) bdy_mask( P_XSB ) = ( sd3 <= sp3 .AND. sp3 <= sd3+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd2 <= sp2 .AND. sp2 <= sd2+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed3-spec_bdy_width-1 <= ep3 .AND. ep3 <= ed3 ) bdy_mask( P_YEB ) = ( ed2-spec_bdy_width-1 <= ep2 .AND. ep2 <= ed2 ) CASE ( DATA_ORDER_XZY ) bdy_mask( P_XSB ) = ( sd1 <= sp1 .AND. sp1 <= sd1+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd3 <= sp3 .AND. sp3 <= sd3+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed1-spec_bdy_width-1 <= ep1 .AND. ep1 <= ed1 ) bdy_mask( P_YEB ) = ( ed3-spec_bdy_width-1 <= ep3 .AND. ep3 <= ed3 ) CASE ( DATA_ORDER_YZX ) bdy_mask( P_XSB ) = ( sd3 <= sp3 .AND. sp3 <= sd3+spec_bdy_width-1 ) bdy_mask( P_YSB ) = ( sd1 <= sp1 .AND. sp1 <= sd1+spec_bdy_width-1 ) bdy_mask( P_XEB ) = ( ed3-spec_bdy_width-1 <= ep3 .AND. ep3 <= ed3 ) bdy_mask( P_YEB ) = ( ed1-spec_bdy_width-1 <= ep1 .AND. ep1 <= ed1 ) END SELECT RETURN END SUBROUTINE wrf_patch_domain SUBROUTINE alloc_and_configure_domain ( domain_id , active_this_task, grid , parent, kid ) IMPLICIT NONE INTEGER , INTENT(IN) :: domain_id LOGICAL , OPTIONAL, INTENT(IN) :: active_this_task TYPE( domain ) , POINTER :: grid TYPE( domain ) , POINTER :: parent INTEGER , INTENT(IN) :: kid INTEGER :: sd1 , ed1 , sp1 , ep1 , sm1 , em1 INTEGER :: sd2 , ed2 , sp2 , ep2 , sm2 , em2 INTEGER :: sd3 , ed3 , sp3 , ep3 , sm3 , em3 INTEGER :: sd1x , ed1x , sp1x , ep1x , sm1x , em1x INTEGER :: sd2x , ed2x , sp2x , ep2x , sm2x , em2x INTEGER :: sd3x , ed3x , sp3x , ep3x , sm3x , em3x INTEGER :: sd1y , ed1y , sp1y , ep1y , sm1y , em1y INTEGER :: sd2y , ed2y , sp2y , ep2y , sm2y , em2y INTEGER :: sd3y , ed3y , sp3y , ep3y , sm3y , em3y TYPE(domain) , POINTER :: new_grid INTEGER :: i INTEGER :: parent_id , parent_domdesc , new_domdesc INTEGER :: bdyzone_x , bdyzone_y INTEGER :: nx, ny LOGICAL :: active active = .TRUE. IF ( PRESENT( active_this_task ) ) THEN active = active_this_task ENDIF data_ordering : SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) CALL nl_get_s_we( domain_id , sd1 ) CALL nl_get_e_we( domain_id , ed1 ) CALL nl_get_s_sn( domain_id , sd2 ) CALL nl_get_e_sn( domain_id , ed2 ) CALL nl_get_s_vert( domain_id , sd3 ) CALL nl_get_e_vert( domain_id , ed3 ) nx = ed1-sd1+1 ny = ed2-sd2+1 CASE ( DATA_ORDER_YXZ ) CALL nl_get_s_sn( domain_id , sd1 ) CALL nl_get_e_sn( domain_id , ed1 ) CALL nl_get_s_we( domain_id , sd2 ) CALL nl_get_e_we( domain_id , ed2 ) CALL nl_get_s_vert( domain_id , sd3 ) CALL nl_get_e_vert( domain_id , ed3 ) nx = ed2-sd2+1 ny = ed1-sd1+1 CASE ( DATA_ORDER_ZXY ) CALL nl_get_s_vert( domain_id , sd1 ) CALL nl_get_e_vert( domain_id , ed1 ) CALL nl_get_s_we( domain_id , sd2 ) CALL nl_get_e_we( domain_id , ed2 ) CALL nl_get_s_sn( domain_id , sd3 ) CALL nl_get_e_sn( domain_id , ed3 ) nx = ed2-sd2+1 ny = ed3-sd3+1 CASE ( DATA_ORDER_ZYX ) CALL nl_get_s_vert( domain_id , sd1 ) CALL nl_get_e_vert( domain_id , ed1 ) CALL nl_get_s_sn( domain_id , sd2 ) CALL nl_get_e_sn( domain_id , ed2 ) CALL nl_get_s_we( domain_id , sd3 ) CALL nl_get_e_we( domain_id , ed3 ) nx = ed3-sd3+1 ny = ed2-sd2+1 CASE ( DATA_ORDER_XZY ) CALL nl_get_s_we( domain_id , sd1 ) CALL nl_get_e_we( domain_id , ed1 ) CALL nl_get_s_vert( domain_id , sd2 ) CALL nl_get_e_vert( domain_id , ed2 ) CALL nl_get_s_sn( domain_id , sd3 ) CALL nl_get_e_sn( domain_id , ed3 ) nx = ed1-sd1+1 ny = ed3-sd3+1 CASE ( DATA_ORDER_YZX ) CALL nl_get_s_sn( domain_id , sd1 ) CALL nl_get_e_sn( domain_id , ed1 ) CALL nl_get_s_vert( domain_id , sd2 ) CALL nl_get_e_vert( domain_id , ed2 ) CALL nl_get_s_we( domain_id , sd3 ) CALL nl_get_e_we( domain_id , ed3 ) nx = ed3-sd3+1 ny = ed1-sd1+1 END SELECT data_ordering IF ( num_time_levels > 3 ) THEN WRITE ( wrf_err_message , * ) 'alloc_and_configure_domain: ', & 'Incorrect value for num_time_levels ', num_time_levels CALL wrf_error_fatal3("",614,& TRIM ( wrf_err_message ) ) ENDIF IF (ASSOCIATED(parent)) THEN parent_id = parent%id parent_domdesc = parent%domdesc ELSE parent_id = -1 parent_domdesc = -1 ENDIF CALL get_bdyzone_x( bdyzone_x ) CALL get_bdyzone_y( bdyzone_y ) ALLOCATE ( new_grid ) ALLOCATE( new_grid%head_statevars ) new_grid%head_statevars%Ndim = 0 NULLIFY( new_grid%head_statevars%next) new_grid%tail_statevars => new_grid%head_statevars ALLOCATE ( new_grid%parents( max_parents ) ) ALLOCATE ( new_grid%nests( max_nests ) ) NULLIFY( new_grid%sibling ) DO i = 1, max_nests NULLIFY( new_grid%nests(i)%ptr ) ENDDO NULLIFY (new_grid%next) NULLIFY (new_grid%same_level) NULLIFY (new_grid%i_start) NULLIFY (new_grid%j_start) NULLIFY (new_grid%i_end) NULLIFY (new_grid%j_end) ALLOCATE( new_grid%domain_clock ) new_grid%domain_clock_created = .FALSE. ALLOCATE( new_grid%alarms( MAX_WRF_ALARMS ) ) ALLOCATE( new_grid%alarms_created( MAX_WRF_ALARMS ) ) DO i = 1, MAX_WRF_ALARMS new_grid%alarms_created( i ) = .FALSE. ENDDO new_grid%time_set = .FALSE. new_grid%is_intermediate = .FALSE. new_grid%have_displayed_alloc_stats = .FALSE. new_grid%tiling_latch = .FALSE. IF ( domain_id .NE. 1 ) THEN new_grid%parents(1)%ptr => parent new_grid%num_parents = 1 parent%nests(kid)%ptr => new_grid new_grid%child_of_parent(1) = kid parent%num_nests = parent%num_nests + 1 IF ( parent%num_nests .GT. 1 ) THEN CALL nl_set_multi_storm(1,.FALSE.) ENDIF END IF new_grid%id = domain_id new_grid%active_this_task = active CALL wrf_patch_domain( domain_id , new_domdesc , parent, parent_id, parent_domdesc , & sd1 , ed1 , sp1 , ep1 , sm1 , em1 , & sd2 , ed2 , sp2 , ep2 , sm2 , em2 , & sd3 , ed3 , sp3 , ep3 , sm3 , em3 , & sp1x , ep1x , sm1x , em1x , & sp2x , ep2x , sm2x , em2x , & sp3x , ep3x , sm3x , em3x , & sp1y , ep1y , sm1y , em1y , & sp2y , ep2y , sm2y , em2y , & sp3y , ep3y , sm3y , em3y , & bdyzone_x , bdyzone_y , new_grid%bdy_mask & ) new_grid%domdesc = new_domdesc new_grid%num_nests = 0 new_grid%num_siblings = 0 new_grid%num_parents = 0 new_grid%max_tiles = 0 new_grid%num_tiles_spec = 0 new_grid%nframes = 0 new_grid%active_this_task = active CALL alloc_space_field ( new_grid, domain_id , 3 , 3 , .FALSE. , active, & sd1, ed1, sd2, ed2, sd3, ed3, & sm1, em1, sm2, em2, sm3, em3, & sp1, ep1, sp2, ep2, sp3, ep3, & sp1x, ep1x, sp2x, ep2x, sp3x, ep3x, & sp1y, ep1y, sp2y, ep2y, sp3y, ep3y, & sm1x, em1x, sm2x, em2x, sm3x, em3x, & sm1y, em1y, sm2y, em2y, sm3y, em3y & ) new_grid%xi = -1.0 new_grid%xj = -1.0 new_grid%vc_i = -1.0 new_grid%vc_j = -1.0 new_grid%sd31 = sd1 new_grid%ed31 = ed1 new_grid%sp31 = sp1 new_grid%ep31 = ep1 new_grid%sm31 = sm1 new_grid%em31 = em1 new_grid%sd32 = sd2 new_grid%ed32 = ed2 new_grid%sp32 = sp2 new_grid%ep32 = ep2 new_grid%sm32 = sm2 new_grid%em32 = em2 new_grid%sd33 = sd3 new_grid%ed33 = ed3 new_grid%sp33 = sp3 new_grid%ep33 = ep3 new_grid%sm33 = sm3 new_grid%em33 = em3 new_grid%sp31x = sp1x new_grid%ep31x = ep1x new_grid%sm31x = sm1x new_grid%em31x = em1x new_grid%sp32x = sp2x new_grid%ep32x = ep2x new_grid%sm32x = sm2x new_grid%em32x = em2x new_grid%sp33x = sp3x new_grid%ep33x = ep3x new_grid%sm33x = sm3x new_grid%em33x = em3x new_grid%sp31y = sp1y new_grid%ep31y = ep1y new_grid%sm31y = sm1y new_grid%em31y = em1y new_grid%sp32y = sp2y new_grid%ep32y = ep2y new_grid%sm32y = sm2y new_grid%em32y = em2y new_grid%sp33y = sp3y new_grid%ep33y = ep3y new_grid%sm33y = sm3y new_grid%em33y = em3y SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) new_grid%sd21 = sd1 ; new_grid%sd22 = sd2 ; new_grid%ed21 = ed1 ; new_grid%ed22 = ed2 ; new_grid%sp21 = sp1 ; new_grid%sp22 = sp2 ; new_grid%ep21 = ep1 ; new_grid%ep22 = ep2 ; new_grid%sm21 = sm1 ; new_grid%sm22 = sm2 ; new_grid%em21 = em1 ; new_grid%em22 = em2 ; new_grid%sd11 = sd1 new_grid%ed11 = ed1 new_grid%sp11 = sp1 new_grid%ep11 = ep1 new_grid%sm11 = sm1 new_grid%em11 = em1 CASE ( DATA_ORDER_YXZ ) new_grid%sd21 = sd1 ; new_grid%sd22 = sd2 ; new_grid%ed21 = ed1 ; new_grid%ed22 = ed2 ; new_grid%sp21 = sp1 ; new_grid%sp22 = sp2 ; new_grid%ep21 = ep1 ; new_grid%ep22 = ep2 ; new_grid%sm21 = sm1 ; new_grid%sm22 = sm2 ; new_grid%em21 = em1 ; new_grid%em22 = em2 ; new_grid%sd11 = sd1 new_grid%ed11 = ed1 new_grid%sp11 = sp1 new_grid%ep11 = ep1 new_grid%sm11 = sm1 new_grid%em11 = em1 CASE ( DATA_ORDER_ZXY ) new_grid%sd21 = sd2 ; new_grid%sd22 = sd3 ; new_grid%ed21 = ed2 ; new_grid%ed22 = ed3 ; new_grid%sp21 = sp2 ; new_grid%sp22 = sp3 ; new_grid%ep21 = ep2 ; new_grid%ep22 = ep3 ; new_grid%sm21 = sm2 ; new_grid%sm22 = sm3 ; new_grid%em21 = em2 ; new_grid%em22 = em3 ; new_grid%sd11 = sd2 new_grid%ed11 = ed2 new_grid%sp11 = sp2 new_grid%ep11 = ep2 new_grid%sm11 = sm2 new_grid%em11 = em2 CASE ( DATA_ORDER_ZYX ) new_grid%sd21 = sd2 ; new_grid%sd22 = sd3 ; new_grid%ed21 = ed2 ; new_grid%ed22 = ed3 ; new_grid%sp21 = sp2 ; new_grid%sp22 = sp3 ; new_grid%ep21 = ep2 ; new_grid%ep22 = ep3 ; new_grid%sm21 = sm2 ; new_grid%sm22 = sm3 ; new_grid%em21 = em2 ; new_grid%em22 = em3 ; new_grid%sd11 = sd2 new_grid%ed11 = ed2 new_grid%sp11 = sp2 new_grid%ep11 = ep2 new_grid%sm11 = sm2 new_grid%em11 = em2 CASE ( DATA_ORDER_XZY ) new_grid%sd21 = sd1 ; new_grid%sd22 = sd3 ; new_grid%ed21 = ed1 ; new_grid%ed22 = ed3 ; new_grid%sp21 = sp1 ; new_grid%sp22 = sp3 ; new_grid%ep21 = ep1 ; new_grid%ep22 = ep3 ; new_grid%sm21 = sm1 ; new_grid%sm22 = sm3 ; new_grid%em21 = em1 ; new_grid%em22 = em3 ; new_grid%sd11 = sd1 new_grid%ed11 = ed1 new_grid%sp11 = sp1 new_grid%ep11 = ep1 new_grid%sm11 = sm1 new_grid%em11 = em1 CASE ( DATA_ORDER_YZX ) new_grid%sd21 = sd1 ; new_grid%sd22 = sd3 ; new_grid%ed21 = ed1 ; new_grid%ed22 = ed3 ; new_grid%sp21 = sp1 ; new_grid%sp22 = sp3 ; new_grid%ep21 = ep1 ; new_grid%ep22 = ep3 ; new_grid%sm21 = sm1 ; new_grid%sm22 = sm3 ; new_grid%em21 = em1 ; new_grid%em22 = em3 ; new_grid%sd11 = sd1 new_grid%ed11 = ed1 new_grid%sp11 = sp1 new_grid%ep11 = ep1 new_grid%sm11 = sm1 new_grid%em11 = em1 END SELECT CALL med_add_config_info_to_grid ( new_grid ) new_grid%tiled = .false. new_grid%patched = .false. NULLIFY(new_grid%mapping) grid => new_grid IF ( grid%active_this_task ) THEN ALLOCATE( grid%lattsloc( grid%max_ts_locs ) ) ALLOCATE( grid%lontsloc( grid%max_ts_locs ) ) ALLOCATE( grid%nametsloc( grid%max_ts_locs ) ) ALLOCATE( grid%desctsloc( grid%max_ts_locs ) ) ALLOCATE( grid%itsloc( grid%max_ts_locs ) ) ALLOCATE( grid%jtsloc( grid%max_ts_locs ) ) ALLOCATE( grid%id_tsloc( grid%max_ts_locs ) ) ALLOCATE( grid%ts_filename( grid%max_ts_locs ) ) grid%ntsloc = 0 grid%ntsloc_domain = 0 ELSE WRITE (wrf_err_message,*)"Not allocating time series storage for domain ",domain_id," on this set of tasks" CALL wrf_message(TRIM(wrf_err_message)) ENDIF CALL wrf_get_dm_communicator_for_id( grid%id, grid%communicator ) CALL wrf_dm_define_comms( grid ) grid%interp_mp = .not. (in_use_for_config(grid%id,'f_ice') .or.& in_use_for_config(grid%id,'f_rain') .or. & in_use_for_config(grid%id,'f_rimef') ) END SUBROUTINE alloc_and_configure_domain SUBROUTINE get_fieldstr(ix,c,instr,outstr,noutstr,noerr) IMPLICIT NONE INTEGER, INTENT(IN) :: ix CHARACTER*(*), INTENT(IN) :: c CHARACTER*(*), INTENT(IN) :: instr CHARACTER*(*), INTENT(OUT) :: outstr INTEGER, INTENT(IN) :: noutstr LOGICAL, INTENT(INOUT) :: noerr INTEGER, PARAMETER :: MAX_DEXES = 100 INTEGER I, PREV, IDEX INTEGER DEXES(MAX_DEXES) outstr = "" prev = 1 dexes(1) = 1 DO i = 2,MAX_DEXES idex = INDEX(instr(prev:LEN(TRIM(instr))),c) IF ( idex .GT. 0 ) THEN dexes(i) = idex+prev prev = dexes(i)+1 ELSE dexes(i) = LEN(TRIM(instr))+2 ENDIF ENDDO IF ( (dexes(ix+1)-2)-(dexes(ix)) .GT. noutstr ) THEN noerr = .FALSE. ELSE IF( dexes(ix) .EQ. dexes(ix+1) ) THEN noerr = .FALSE. ELSE outstr = instr(dexes(ix):(dexes(ix+1)-2)) noerr = noerr .AND. .TRUE. ENDIF END SUBROUTINE get_fieldstr SUBROUTINE change_to_lower_case(instr,outstr) CHARACTER*(*) ,INTENT(IN) :: instr CHARACTER*(*) ,INTENT(OUT) :: outstr CHARACTER*1 :: c INTEGER ,PARAMETER :: upper_to_lower =IACHAR('a')-IACHAR('A') INTEGER :: i,n,n1 outstr = ' ' N = len(instr) N1 = len(outstr) N = MIN(N,N1) outstr(1:N) = instr(1:N) DO i=1,N c = instr(i:i) if('A'<=c .and. c <='Z') outstr(i:i)=achar(iachar(c)+upper_to_lower) ENDDO RETURN END SUBROUTINE change_to_lower_case SUBROUTINE modify_io_masks1 ( grid , id ) IMPLICIT NONE INTEGER , INTENT(IN ) :: id TYPE(domain), POINTER :: grid TYPE(fieldlist), POINTER :: p, q INTEGER, PARAMETER :: read_unit = 10 LOGICAL, EXTERNAL :: wrf_dm_on_monitor CHARACTER*256 :: fname, inln, mess, dname, t1, lookee CHARACTER*256 :: fieldlst CHARACTER*1 :: op, strmtyp CHARACTER*3 :: strmid CHARACTER*10 :: strmtyp_name INTEGER :: io_status INTEGER :: strmtyp_int, count_em INTEGER :: lineno, fieldno, istrm, retval, itrace LOGICAL :: keepgoing, noerr, gavewarning, ignorewarning, found LOGICAL, SAVE :: you_warned_me = .FALSE. LOGICAL, SAVE :: you_warned_me2(max_hst_mods,max_domains) = .FALSE. gavewarning = .FALSE. CALL nl_get_iofields_filename( id, fname ) IF ( grid%is_intermediate ) RETURN IF ( TRIM(fname) .EQ. "NONE_SPECIFIED" ) RETURN IF ( wrf_dm_on_monitor() ) THEN OPEN ( UNIT = read_unit , & FILE = TRIM(fname) , & FORM = "FORMATTED" , & STATUS = "OLD" , & IOSTAT = io_status ) IF ( io_status .EQ. 0 ) THEN keepgoing = .TRUE. lineno = 0 count_em = 0 DO WHILE ( keepgoing ) READ(UNIT=read_unit,FMT='(A)',IOSTAT=io_status) inln keepgoing = (io_status .EQ. 0) .AND. (LEN(TRIM(inln)) .GT. 0) IF ( keepgoing ) THEN lineno = lineno + 1 IF ( .NOT. LEN(TRIM(inln)) .LT. LEN(inln) ) THEN WRITE(mess,*)'W A R N I N G : Line ',lineno,' of ',TRIM(fname),' is too long. Limit is ',LEN(inln),' characters.' gavewarning = .TRUE. ENDIF IF ( INDEX(inln,'#') .EQ. 0 ) THEN IF ( keepgoing ) THEN noerr = .TRUE. CALL get_fieldstr(1,':',inln,op,1,noerr) IF ( TRIM(op) .NE. '+' .AND. TRIM(op) .NE. '-' ) THEN WRITE(mess,*)'W A R N I N G : unknown operation ',TRIM(op),' (should be + or -). Line ',lineno gavewarning = .TRUE. ENDIF CALL get_fieldstr(2,':',inln,t1,1,noerr) CALL change_to_lower_case(t1,strmtyp) SELECT CASE (TRIM(strmtyp)) CASE ('h') strmtyp_name = 'history' strmtyp_int = first_history CASE ('i') strmtyp_name = 'input' strmtyp_int = first_input CASE DEFAULT WRITE(mess,*)'W A R N I N G : unknown stream type ',TRIM(strmtyp),'. Line ',lineno gavewarning = .TRUE. END SELECT CALL get_fieldstr(3,':',inln,strmid,3,noerr) READ(strmid,'(I3)') istrm IF ( istrm .LT. 0 .OR. istrm .GT. last_history ) THEN WRITE(mess,*)'W A R N I N G : invalid stream id ',istrm,' (should be 0 <= id <= ',last_history,'). Line ',lineno gavewarning = .TRUE. ENDIF CALL get_fieldstr(4,':',inln,fieldlst,1024,noerr) IF ( noerr ) THEN fieldno = 1 CALL get_fieldstr(fieldno,',',fieldlst,t1,256,noerr) CALL change_to_lower_case(t1,lookee) DO WHILE ( noerr ) p => grid%head_statevars%next found = .FALSE. count_em = count_em + 1 DO WHILE ( ASSOCIATED( p ) ) IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id) CALL change_to_lower_case( p%dname_table( grid%id, itrace ) , dname ) IF ( TRIM(dname) .EQ. TRIM(lookee) ) & CALL warn_me_or_set_mask (id, istrm, lineno, strmtyp_int, count_em, op, & strmtyp_name, dname, fname, lookee, & p%streams_table(grid%id,itrace)%stream, & mess, found, you_warned_me2) ENDDO ELSE IF ( p%Ntl .GT. 0 ) THEN CALL change_to_lower_case(p%DataName(1:LEN(TRIM(p%DataName))-2),dname) ELSE CALL change_to_lower_case(p%DataName,dname) ENDIF IF ( TRIM(dname) .EQ. TRIM(lookee) ) & CALL warn_me_or_set_mask (id, istrm, lineno, strmtyp_int, count_em, op, & strmtyp_name, dname, fname, lookee, & p%streams, mess, found, you_warned_me2) ENDIF p => p%next ENDDO IF ( .NOT. found ) THEN WRITE(mess,*)'W A R N I N G : Unable to modify mask for ',TRIM(lookee),& '. Variable not found. File: ',TRIM(fname),' at line ',lineno CALL wrf_message(mess) gavewarning = .TRUE. ENDIF fieldno = fieldno + 1 CALL get_fieldstr(fieldno,',',fieldlst,t1,256,noerr) CALL change_to_lower_case(t1,lookee) ENDDO ELSE WRITE(mess,*)'W A R N I N G : Problem reading ',TRIM(fname),' at line ',lineno CALL wrf_message(mess) gavewarning = .TRUE. ENDIF ENDIF ENDIF ENDIF ENDDO ELSE WRITE(mess,*)'W A R N I N G : Problem opening ',TRIM(fname) CALL wrf_message(mess) gavewarning = .TRUE. ENDIF CLOSE( read_unit ) IF ( gavewarning ) THEN CALL nl_get_ignore_iofields_warning(1,ignorewarning) IF ( .NOT. ignorewarning ) THEN CALL wrf_message(mess) WRITE(mess,*)'modify_io_masks: problems reading ',TRIM(fname) CALL wrf_message(mess) CALL wrf_error_fatal3("",1112,& 'Set ignore_iofields_warn to true in namelist to ignore') ELSE IF ( .NOT. you_warned_me ) THEN if ( .NOT. you_warned_me2(count_em,id) ) CALL wrf_message(mess) WRITE(mess,*)'Ignoring problems reading ',TRIM(fname) CALL wrf_message(mess) CALL wrf_message('Continuing. To make this a fatal error, set ignore_iofields_warn to false in namelist' ) CALL wrf_message(' ') you_warned_me = .TRUE. ENDIF ENDIF ENDIF ENDIF p => grid%head_statevars%next DO WHILE ( ASSOCIATED( p ) ) IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id) CALL wrf_dm_bcast_integer( p%streams_table(grid%id,itrace)%stream, (((2*(25)+2))/(4*8)+1) ) ENDDO ELSE CALL wrf_dm_bcast_integer( p%streams, (((2*(25)+2))/(4*8)+1) ) ENDIF p => p%next ENDDO END SUBROUTINE modify_io_masks1 SUBROUTINE warn_me_or_set_mask (id, istrm, lineno, strmtyp_int, count_em, op, & strmtyp_name, dname, fname, lookee, & p_stream, mess, found, you_warned_me2) IMPLICIT NONE INTEGER, INTENT(IN ) :: id, istrm, lineno, strmtyp_int INTEGER, INTENT(IN ) :: p_stream(*), count_em CHARACTER*1, INTENT(IN ) :: op CHARACTER*10, INTENT(IN ) :: strmtyp_name CHARACTER*256, INTENT(IN ) :: dname, fname, lookee CHARACTER*256, INTENT(OUT) :: mess LOGICAL, INTENT(OUT) :: found LOGICAL, INTENT(INOUT) :: you_warned_me2(max_hst_mods,max_domains) INTEGER :: retval found = .TRUE. IF ( TRIM(op) .EQ. '+' ) THEN CALL get_mask( p_stream, strmtyp_int + istrm - 1, retval ) IF ( retval .NE. 0 ) THEN WRITE(mess,*) 'Domain ',id, ' W A R N I N G : Variable ',TRIM(lookee),' already on ', & TRIM(strmtyp_name), ' stream ',istrm, '. File: ', TRIM(fname),' at line ',lineno ELSE WRITE(mess,*) 'Domain ', id, ' Setting ', TRIM(strmtyp_name), ' stream ',istrm,' for ', & TRIM(DNAME) ; CALL wrf_debug(1,mess) CALL set_mask( p_stream, strmtyp_int + istrm - 1 ) ENDIF ELSE IF ( TRIM(op) .EQ. '-' ) THEN CALL get_mask( p_stream, strmtyp_int + istrm - 1, retval ) IF ( retval .EQ. 0 ) THEN WRITE(mess,*) 'Domain ',id, ' W A R N I N G : Variable ',TRIM(lookee),' already off ', & TRIM(strmtyp_name), ' stream ',istrm, '. File: ',TRIM(fname),' at line ',lineno ELSE WRITE(mess,*) 'Domain ', id, ' Resetting ', TRIM(strmtyp_name), ' stream ',istrm,' for ', & TRIM(DNAME) ; CALL wrf_debug(1,mess) CALL reset_mask( p_stream, strmtyp_int + istrm - 1) ENDIF ENDIF IF ( count_em > max_hst_mods ) THEN WRITE(mess,*)'ERROR module_domain: Array size for you_warned_me2 is fixed at ',max_hst_mods CALL wrf_message(mess) CALL wrf_error_fatal3("",1191,& 'Did you really type > max_hst_mods fields into ', TRIM(fname) ,' ?') ELSE IF ( .NOT. you_warned_me2(count_em,id) ) THEN CALL wrf_message(mess) you_warned_me2(count_em,id) = .TRUE. ENDIF ENDIF END SUBROUTINE warn_me_or_set_mask SUBROUTINE alloc_space_field ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) USE module_alloc_space_0, ONLY : alloc_space_field_core_0 USE module_alloc_space_1, ONLY : alloc_space_field_core_1 USE module_alloc_space_2, ONLY : alloc_space_field_core_2 USE module_alloc_space_3, ONLY : alloc_space_field_core_3 USE module_alloc_space_4, ONLY : alloc_space_field_core_4 USE module_alloc_space_5, ONLY : alloc_space_field_core_5 USE module_alloc_space_6, ONLY : alloc_space_field_core_6 USE module_alloc_space_7, ONLY : alloc_space_field_core_7 USE module_alloc_space_8, ONLY : alloc_space_field_core_8 USE module_alloc_space_9, ONLY : alloc_space_field_core_9 IMPLICIT NONE TYPE(domain) , POINTER :: grid INTEGER , INTENT(IN) :: id INTEGER , INTENT(IN) :: setinitval_in INTEGER , INTENT(IN) :: sd31, ed31, sd32, ed32, sd33, ed33 INTEGER , INTENT(IN) :: sm31, em31, sm32, em32, sm33, em33 INTEGER , INTENT(IN) :: sp31, ep31, sp32, ep32, sp33, ep33 INTEGER , INTENT(IN) :: sp31x, ep31x, sp32x, ep32x, sp33x, ep33x INTEGER , INTENT(IN) :: sp31y, ep31y, sp32y, ep32y, sp33y, ep33y INTEGER , INTENT(IN) :: sm31x, em31x, sm32x, em32x, sm33x, em33x INTEGER , INTENT(IN) :: sm31y, em31y, sm32y, em32y, sm33y, em33y INTEGER , INTENT(IN) :: tl_in LOGICAL , INTENT(IN) :: inter_domain_in, okay_to_alloc_in INTEGER(KIND=8) num_bytes_allocated INTEGER idum1, idum2 IF ( grid%id .EQ. 1 ) & CALL wrf_message ( 'DYNAMICS OPTION: nmm dyncore' ) CALL set_scalar_indices_from_config( id , idum1 , idum2 ) num_bytes_allocated = 0 CALL alloc_space_field_core_0 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_1 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_2 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_3 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_4 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_5 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_6 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_7 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_8 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) CALL alloc_space_field_core_9 ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, num_bytes_allocated , & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) IF ( .NOT. grid%have_displayed_alloc_stats ) THEN WRITE(wrf_err_message,*)& 'alloc_space_field: domain ',id,', ',num_bytes_allocated,' bytes allocated' CALL wrf_debug( 0, wrf_err_message ) grid%have_displayed_alloc_stats = .TRUE. ENDIF grid%alloced_sd31=sd31 grid%alloced_ed31=ed31 grid%alloced_sd32=sd32 grid%alloced_ed32=ed32 grid%alloced_sd33=sd33 grid%alloced_ed33=ed33 grid%alloced_sm31=sm31 grid%alloced_em31=em31 grid%alloced_sm32=sm32 grid%alloced_em32=em32 grid%alloced_sm33=sm33 grid%alloced_em33=em33 grid%alloced_sm31x=sm31x grid%alloced_em31x=em31x grid%alloced_sm32x=sm32x grid%alloced_em32x=em32x grid%alloced_sm33x=sm33x grid%alloced_em33x=em33x grid%alloced_sm31y=sm31y grid%alloced_em31y=em31y grid%alloced_sm32y=sm32y grid%alloced_em32y=em32y grid%alloced_sm33y=sm33y grid%alloced_em33y=em33y grid%allocated=.TRUE. END SUBROUTINE alloc_space_field SUBROUTINE ensure_space_field ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) IMPLICIT NONE TYPE(domain) , POINTER :: grid INTEGER , INTENT(IN) :: id INTEGER , INTENT(IN) :: setinitval_in INTEGER , INTENT(IN) :: sd31, ed31, sd32, ed32, sd33, ed33 INTEGER , INTENT(IN) :: sm31, em31, sm32, em32, sm33, em33 INTEGER , INTENT(IN) :: sp31, ep31, sp32, ep32, sp33, ep33 INTEGER , INTENT(IN) :: sp31x, ep31x, sp32x, ep32x, sp33x, ep33x INTEGER , INTENT(IN) :: sp31y, ep31y, sp32y, ep32y, sp33y, ep33y INTEGER , INTENT(IN) :: sm31x, em31x, sm32x, em32x, sm33x, em33x INTEGER , INTENT(IN) :: sm31y, em31y, sm32y, em32y, sm33y, em33y INTEGER , INTENT(IN) :: tl_in LOGICAL , INTENT(IN) :: inter_domain_in, okay_to_alloc_in LOGICAL :: size_changed size_changed= .not. ( & grid%alloced_sd31 .eq. sd31 .and. grid%alloced_ed31 .eq. ed31 .and. & grid%alloced_sd32 .eq. sd32 .and. grid%alloced_ed32 .eq. ed32 .and. & grid%alloced_sd33 .eq. sd33 .and. grid%alloced_ed33 .eq. ed33 .and. & grid%alloced_sm31 .eq. sm31 .and. grid%alloced_em31 .eq. em31 .and. & grid%alloced_sm32 .eq. sm32 .and. grid%alloced_em32 .eq. em32 .and. & grid%alloced_sm33 .eq. sm33 .and. grid%alloced_em33 .eq. em33 .and. & grid%alloced_sm31x .eq. sm31x .and. grid%alloced_em31x .eq. em31x .and. & grid%alloced_sm32x .eq. sm32x .and. grid%alloced_em32x .eq. em32x .and. & grid%alloced_sm33x .eq. sm33x .and. grid%alloced_em33x .eq. em33x .and. & grid%alloced_sm31y .eq. sm31y .and. grid%alloced_em31y .eq. em31y .and. & grid%alloced_sm32y .eq. sm32y .and. grid%alloced_em32y .eq. em32y .and. & grid%alloced_sm33y .eq. sm33y .and. grid%alloced_em33y .eq. em33y & ) if(.not. grid%allocated .or. size_changed) then if(.not. grid%allocated) then call wrf_debug(1,'ensure_space_field: calling alloc_space_field because a grid was not allocated.') else if(size_changed) & call wrf_debug(1,'ensure_space_field: deallocating and reallocating a grid because grid size changed.') end if if(grid%allocated) & call dealloc_space_field( grid ) call alloc_space_field ( grid, id, setinitval_in , tl_in , inter_domain_in , okay_to_alloc_in, & sd31, ed31, sd32, ed32, sd33, ed33, & sm31 , em31 , sm32 , em32 , sm33 , em33 , & sp31 , ep31 , sp32 , ep32 , sp33 , ep33 , & sp31x, ep31x, sp32x, ep32x, sp33x, ep33x, & sp31y, ep31y, sp32y, ep32y, sp33y, ep33y, & sm31x, em31x, sm32x, em32x, sm33x, em33x, & sm31y, em31y, sm32y, em32y, sm33y, em33y ) end if END SUBROUTINE ensure_space_field SUBROUTINE dealloc_space_domain ( id ) IMPLICIT NONE INTEGER , INTENT(IN) :: id TYPE(domain) , POINTER :: grid LOGICAL :: found grid => head_grid old_grid => head_grid found = .FALSE. find_grid : DO WHILE ( ASSOCIATED(grid) ) IF ( grid%id == id ) THEN found = .TRUE. old_grid%next => grid%next CALL domain_destroy( grid ) EXIT find_grid END IF old_grid => grid grid => grid%next END DO find_grid IF ( .NOT. found ) THEN WRITE ( wrf_err_message , * ) 'module_domain: ', & 'dealloc_space_domain: Could not de-allocate grid id ',id CALL wrf_error_fatal3("",1518,& TRIM( wrf_err_message ) ) END IF END SUBROUTINE dealloc_space_domain SUBROUTINE domain_destroy ( grid ) IMPLICIT NONE TYPE(domain) , POINTER :: grid CALL dealloc_space_field ( grid ) CALL dealloc_linked_lists( grid ) DEALLOCATE( grid%parents ) DEALLOCATE( grid%nests ) CALL domain_clock_destroy( grid ) CALL domain_alarms_destroy( grid ) IF ( ASSOCIATED( grid%i_start ) ) THEN DEALLOCATE( grid%i_start ) ENDIF IF ( ASSOCIATED( grid%i_end ) ) THEN DEALLOCATE( grid%i_end ) ENDIF IF ( ASSOCIATED( grid%j_start ) ) THEN DEALLOCATE( grid%j_start ) ENDIF IF ( ASSOCIATED( grid%j_end ) ) THEN DEALLOCATE( grid%j_end ) ENDIF IF ( ASSOCIATED( grid%itsloc ) ) THEN DEALLOCATE( grid%itsloc ) ENDIF IF ( ASSOCIATED( grid%jtsloc ) ) THEN DEALLOCATE( grid%jtsloc ) ENDIF IF ( ASSOCIATED( grid%id_tsloc ) ) THEN DEALLOCATE( grid%id_tsloc ) ENDIF IF ( ASSOCIATED( grid%lattsloc ) ) THEN DEALLOCATE( grid%lattsloc ) ENDIF IF ( ASSOCIATED( grid%lontsloc ) ) THEN DEALLOCATE( grid%lontsloc ) ENDIF IF ( ASSOCIATED( grid%nametsloc ) ) THEN DEALLOCATE( grid%nametsloc ) ENDIF IF ( ASSOCIATED( grid%desctsloc ) ) THEN DEALLOCATE( grid%desctsloc ) ENDIF IF ( ASSOCIATED( grid%ts_filename ) ) THEN DEALLOCATE( grid%ts_filename ) ENDIF DEALLOCATE( grid ) NULLIFY( grid ) END SUBROUTINE domain_destroy SUBROUTINE dealloc_linked_lists ( grid ) IMPLICIT NONE TYPE(domain), POINTER :: grid TYPE(fieldlist), POINTER :: p, q p => grid%head_statevars DO WHILE ( ASSOCIATED( p ) ) q => p ; p => p%next ; DEALLOCATE(q) ENDDO NULLIFY(grid%head_statevars) ; NULLIFY( grid%tail_statevars) IF ( .NOT. grid%is_intermediate ) THEN ALLOCATE( grid%head_statevars ) NULLIFY( grid%head_statevars%next) grid%tail_statevars => grid%head_statevars ENDIF END SUBROUTINE dealloc_linked_lists RECURSIVE SUBROUTINE show_nest_subtree ( grid ) TYPE(domain), POINTER :: grid INTEGER myid INTEGER kid IF ( .NOT. ASSOCIATED( grid ) ) RETURN myid = grid%id DO kid = 1, max_nests IF ( ASSOCIATED( grid%nests(kid)%ptr ) ) THEN IF ( grid%nests(kid)%ptr%id .EQ. myid ) THEN CALL wrf_error_fatal3("",1612,& 'show_nest_subtree: nest hierarchy corrupted' ) ENDIF CALL show_nest_subtree( grid%nests(kid)%ptr ) ENDIF ENDDO END SUBROUTINE show_nest_subtree SUBROUTINE dealloc_space_field ( grid ) IMPLICIT NONE TYPE(domain) , POINTER :: grid INTEGER :: ierr IF ( ASSOCIATED( grid%lake2d ) ) THEN DEALLOCATE(grid%lake2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1648,& 'frame/module_domain.f: Failed to deallocate grid%lake2d. ') endif ENDIF IF ( ASSOCIATED( grid%lakedepth2d ) ) THEN DEALLOCATE(grid%lakedepth2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1655,& 'frame/module_domain.f: Failed to deallocate grid%lakedepth2d. ') endif ENDIF IF ( ASSOCIATED( grid%savedtke12d ) ) THEN DEALLOCATE(grid%savedtke12d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1662,& 'frame/module_domain.f: Failed to deallocate grid%savedtke12d. ') endif ENDIF IF ( ASSOCIATED( grid%snowdp2d ) ) THEN DEALLOCATE(grid%snowdp2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1669,& 'frame/module_domain.f: Failed to deallocate grid%snowdp2d. ') endif ENDIF IF ( ASSOCIATED( grid%h2osno2d ) ) THEN DEALLOCATE(grid%h2osno2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1676,& 'frame/module_domain.f: Failed to deallocate grid%h2osno2d. ') endif ENDIF IF ( ASSOCIATED( grid%snl2d ) ) THEN DEALLOCATE(grid%snl2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1683,& 'frame/module_domain.f: Failed to deallocate grid%snl2d. ') endif ENDIF IF ( ASSOCIATED( grid%t_grnd2d ) ) THEN DEALLOCATE(grid%t_grnd2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1690,& 'frame/module_domain.f: Failed to deallocate grid%t_grnd2d. ') endif ENDIF IF ( ASSOCIATED( grid%t_lake3d ) ) THEN DEALLOCATE(grid%t_lake3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1697,& 'frame/module_domain.f: Failed to deallocate grid%t_lake3d. ') endif ENDIF IF ( ASSOCIATED( grid%lake_icefrac3d ) ) THEN DEALLOCATE(grid%lake_icefrac3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1704,& 'frame/module_domain.f: Failed to deallocate grid%lake_icefrac3d. ') endif ENDIF IF ( ASSOCIATED( grid%z_lake3d ) ) THEN DEALLOCATE(grid%z_lake3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1711,& 'frame/module_domain.f: Failed to deallocate grid%z_lake3d. ') endif ENDIF IF ( ASSOCIATED( grid%dz_lake3d ) ) THEN DEALLOCATE(grid%dz_lake3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1718,& 'frame/module_domain.f: Failed to deallocate grid%dz_lake3d. ') endif ENDIF IF ( ASSOCIATED( grid%t_soisno3d ) ) THEN DEALLOCATE(grid%t_soisno3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1725,& 'frame/module_domain.f: Failed to deallocate grid%t_soisno3d. ') endif ENDIF IF ( ASSOCIATED( grid%h2osoi_ice3d ) ) THEN DEALLOCATE(grid%h2osoi_ice3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1732,& 'frame/module_domain.f: Failed to deallocate grid%h2osoi_ice3d. ') endif ENDIF IF ( ASSOCIATED( grid%h2osoi_liq3d ) ) THEN DEALLOCATE(grid%h2osoi_liq3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1739,& 'frame/module_domain.f: Failed to deallocate grid%h2osoi_liq3d. ') endif ENDIF IF ( ASSOCIATED( grid%h2osoi_vol3d ) ) THEN DEALLOCATE(grid%h2osoi_vol3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1746,& 'frame/module_domain.f: Failed to deallocate grid%h2osoi_vol3d. ') endif ENDIF IF ( ASSOCIATED( grid%z3d ) ) THEN DEALLOCATE(grid%z3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1753,& 'frame/module_domain.f: Failed to deallocate grid%z3d. ') endif ENDIF IF ( ASSOCIATED( grid%dz3d ) ) THEN DEALLOCATE(grid%dz3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1760,& 'frame/module_domain.f: Failed to deallocate grid%dz3d. ') endif ENDIF IF ( ASSOCIATED( grid%zi3d ) ) THEN DEALLOCATE(grid%zi3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1767,& 'frame/module_domain.f: Failed to deallocate grid%zi3d. ') endif ENDIF IF ( ASSOCIATED( grid%watsat3d ) ) THEN DEALLOCATE(grid%watsat3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1774,& 'frame/module_domain.f: Failed to deallocate grid%watsat3d. ') endif ENDIF IF ( ASSOCIATED( grid%csol3d ) ) THEN DEALLOCATE(grid%csol3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1781,& 'frame/module_domain.f: Failed to deallocate grid%csol3d. ') endif ENDIF IF ( ASSOCIATED( grid%tkmg3d ) ) THEN DEALLOCATE(grid%tkmg3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1788,& 'frame/module_domain.f: Failed to deallocate grid%tkmg3d. ') endif ENDIF IF ( ASSOCIATED( grid%tkdry3d ) ) THEN DEALLOCATE(grid%tkdry3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1795,& 'frame/module_domain.f: Failed to deallocate grid%tkdry3d. ') endif ENDIF IF ( ASSOCIATED( grid%tksatu3d ) ) THEN DEALLOCATE(grid%tksatu3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1802,& 'frame/module_domain.f: Failed to deallocate grid%tksatu3d. ') endif ENDIF IF ( ASSOCIATED( grid%szj ) ) THEN DEALLOCATE(grid%szj,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1809,& 'frame/module_domain.f: Failed to deallocate grid%szj. ') endif ENDIF IF ( ASSOCIATED( grid%s1z ) ) THEN DEALLOCATE(grid%s1z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1816,& 'frame/module_domain.f: Failed to deallocate grid%s1z. ') endif ENDIF IF ( ASSOCIATED( grid%spz ) ) THEN DEALLOCATE(grid%spz,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1823,& 'frame/module_domain.f: Failed to deallocate grid%spz. ') endif ENDIF IF ( ASSOCIATED( grid%tcs ) ) THEN DEALLOCATE(grid%tcs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1830,& 'frame/module_domain.f: Failed to deallocate grid%tcs. ') endif ENDIF IF ( ASSOCIATED( grid%lu_index ) ) THEN DEALLOCATE(grid%lu_index,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1837,& 'frame/module_domain.f: Failed to deallocate grid%lu_index. ') endif ENDIF IF ( ASSOCIATED( grid%lu_mask ) ) THEN DEALLOCATE(grid%lu_mask,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1844,& 'frame/module_domain.f: Failed to deallocate grid%lu_mask. ') endif ENDIF IF ( ASSOCIATED( grid%p_gc ) ) THEN DEALLOCATE(grid%p_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1851,& 'frame/module_domain.f: Failed to deallocate grid%p_gc. ') endif ENDIF IF ( ASSOCIATED( grid%vegcat ) ) THEN DEALLOCATE(grid%vegcat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1858,& 'frame/module_domain.f: Failed to deallocate grid%vegcat. ') endif ENDIF IF ( ASSOCIATED( grid%soilcat ) ) THEN DEALLOCATE(grid%soilcat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1865,& 'frame/module_domain.f: Failed to deallocate grid%soilcat. ') endif ENDIF IF ( ASSOCIATED( grid%input_soil_cat ) ) THEN DEALLOCATE(grid%input_soil_cat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1872,& 'frame/module_domain.f: Failed to deallocate grid%input_soil_cat. ') endif ENDIF IF ( ASSOCIATED( grid%tsk_gc ) ) THEN DEALLOCATE(grid%tsk_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1879,& 'frame/module_domain.f: Failed to deallocate grid%tsk_gc. ') endif ENDIF IF ( ASSOCIATED( grid%xice_gc ) ) THEN DEALLOCATE(grid%xice_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1886,& 'frame/module_domain.f: Failed to deallocate grid%xice_gc. ') endif ENDIF IF ( ASSOCIATED( grid%ght_gc ) ) THEN DEALLOCATE(grid%ght_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1893,& 'frame/module_domain.f: Failed to deallocate grid%ght_gc. ') endif ENDIF IF ( ASSOCIATED( grid%rh_gc ) ) THEN DEALLOCATE(grid%rh_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1900,& 'frame/module_domain.f: Failed to deallocate grid%rh_gc. ') endif ENDIF IF ( ASSOCIATED( grid%v_gc ) ) THEN DEALLOCATE(grid%v_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1907,& 'frame/module_domain.f: Failed to deallocate grid%v_gc. ') endif ENDIF IF ( ASSOCIATED( grid%u_gc ) ) THEN DEALLOCATE(grid%u_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1914,& 'frame/module_domain.f: Failed to deallocate grid%u_gc. ') endif ENDIF IF ( ASSOCIATED( grid%t_gc ) ) THEN DEALLOCATE(grid%t_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1921,& 'frame/module_domain.f: Failed to deallocate grid%t_gc. ') endif ENDIF IF ( ASSOCIATED( grid%snoalb ) ) THEN DEALLOCATE(grid%snoalb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1928,& 'frame/module_domain.f: Failed to deallocate grid%snoalb. ') endif ENDIF IF ( ASSOCIATED( grid%greenfrac_gc ) ) THEN DEALLOCATE(grid%greenfrac_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1935,& 'frame/module_domain.f: Failed to deallocate grid%greenfrac_gc. ') endif ENDIF IF ( ASSOCIATED( grid%albedo12m_gc ) ) THEN DEALLOCATE(grid%albedo12m_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1942,& 'frame/module_domain.f: Failed to deallocate grid%albedo12m_gc. ') endif ENDIF IF ( ASSOCIATED( grid%lai12m_gc ) ) THEN DEALLOCATE(grid%lai12m_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1949,& 'frame/module_domain.f: Failed to deallocate grid%lai12m_gc. ') endif ENDIF IF ( ASSOCIATED( grid%soilcbot_gc ) ) THEN DEALLOCATE(grid%soilcbot_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1956,& 'frame/module_domain.f: Failed to deallocate grid%soilcbot_gc. ') endif ENDIF IF ( ASSOCIATED( grid%soilctop_gc ) ) THEN DEALLOCATE(grid%soilctop_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1963,& 'frame/module_domain.f: Failed to deallocate grid%soilctop_gc. ') endif ENDIF IF ( ASSOCIATED( grid%tmn_gc ) ) THEN DEALLOCATE(grid%tmn_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1970,& 'frame/module_domain.f: Failed to deallocate grid%tmn_gc. ') endif ENDIF IF ( ASSOCIATED( grid%htv_gc ) ) THEN DEALLOCATE(grid%htv_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1977,& 'frame/module_domain.f: Failed to deallocate grid%htv_gc. ') endif ENDIF IF ( ASSOCIATED( grid%ht_gc ) ) THEN DEALLOCATE(grid%ht_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1984,& 'frame/module_domain.f: Failed to deallocate grid%ht_gc. ') endif ENDIF IF ( ASSOCIATED( grid%landusef_gc ) ) THEN DEALLOCATE(grid%landusef_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1991,& 'frame/module_domain.f: Failed to deallocate grid%landusef_gc. ') endif ENDIF IF ( ASSOCIATED( grid%vlon_gc ) ) THEN DEALLOCATE(grid%vlon_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",1998,& 'frame/module_domain.f: Failed to deallocate grid%vlon_gc. ') endif ENDIF IF ( ASSOCIATED( grid%vlat_gc ) ) THEN DEALLOCATE(grid%vlat_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2005,& 'frame/module_domain.f: Failed to deallocate grid%vlat_gc. ') endif ENDIF IF ( ASSOCIATED( grid%hlon_gc ) ) THEN DEALLOCATE(grid%hlon_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2012,& 'frame/module_domain.f: Failed to deallocate grid%hlon_gc. ') endif ENDIF IF ( ASSOCIATED( grid%hlat_gc ) ) THEN DEALLOCATE(grid%hlat_gc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2019,& 'frame/module_domain.f: Failed to deallocate grid%hlat_gc. ') endif ENDIF IF ( ASSOCIATED( grid%nrnd1 ) ) THEN DEALLOCATE(grid%nrnd1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2026,& 'frame/module_domain.f: Failed to deallocate grid%nrnd1. ') endif ENDIF IF ( ASSOCIATED( grid%relaxwork ) ) THEN DEALLOCATE(grid%relaxwork,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2033,& 'frame/module_domain.f: Failed to deallocate grid%relaxwork. ') endif ENDIF IF ( ASSOCIATED( grid%relaximask ) ) THEN DEALLOCATE(grid%relaximask,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2040,& 'frame/module_domain.f: Failed to deallocate grid%relaximask. ') endif ENDIF IF ( ASSOCIATED( grid%relaxmask ) ) THEN DEALLOCATE(grid%relaxmask,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2047,& 'frame/module_domain.f: Failed to deallocate grid%relaxmask. ') endif ENDIF IF ( ASSOCIATED( grid%interesting ) ) THEN DEALLOCATE(grid%interesting,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2054,& 'frame/module_domain.f: Failed to deallocate grid%interesting. ') endif ENDIF IF ( ASSOCIATED( grid%nest_imid ) ) THEN DEALLOCATE(grid%nest_imid,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2061,& 'frame/module_domain.f: Failed to deallocate grid%nest_imid. ') endif ENDIF IF ( ASSOCIATED( grid%nest_jmid ) ) THEN DEALLOCATE(grid%nest_jmid,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2068,& 'frame/module_domain.f: Failed to deallocate grid%nest_jmid. ') endif ENDIF IF ( ASSOCIATED( grid%cuprecip_swath ) ) THEN DEALLOCATE(grid%cuprecip_swath,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2075,& 'frame/module_domain.f: Failed to deallocate grid%cuprecip_swath. ') endif ENDIF IF ( ASSOCIATED( grid%precip_swath ) ) THEN DEALLOCATE(grid%precip_swath,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2082,& 'frame/module_domain.f: Failed to deallocate grid%precip_swath. ') endif ENDIF IF ( ASSOCIATED( grid%windsq_swath ) ) THEN DEALLOCATE(grid%windsq_swath,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2089,& 'frame/module_domain.f: Failed to deallocate grid%windsq_swath. ') endif ENDIF IF ( ASSOCIATED( grid%suswind ) ) THEN DEALLOCATE(grid%suswind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2096,& 'frame/module_domain.f: Failed to deallocate grid%suswind. ') endif ENDIF IF ( ASSOCIATED( grid%wind10_ratio ) ) THEN DEALLOCATE(grid%wind10_ratio,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2103,& 'frame/module_domain.f: Failed to deallocate grid%wind10_ratio. ') endif ENDIF IF ( ASSOCIATED( grid%suswind_swath ) ) THEN DEALLOCATE(grid%suswind_swath,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2110,& 'frame/module_domain.f: Failed to deallocate grid%suswind_swath. ') endif ENDIF IF ( ASSOCIATED( grid%tracker_distsq ) ) THEN DEALLOCATE(grid%tracker_distsq,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2117,& 'frame/module_domain.f: Failed to deallocate grid%tracker_distsq. ') endif ENDIF IF ( ASSOCIATED( grid%tracker_angle ) ) THEN DEALLOCATE(grid%tracker_angle,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2124,& 'frame/module_domain.f: Failed to deallocate grid%tracker_angle. ') endif ENDIF IF ( ASSOCIATED( grid%track_old_lon ) ) THEN DEALLOCATE(grid%track_old_lon,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2131,& 'frame/module_domain.f: Failed to deallocate grid%track_old_lon. ') endif ENDIF IF ( ASSOCIATED( grid%track_old_lat ) ) THEN DEALLOCATE(grid%track_old_lat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2138,& 'frame/module_domain.f: Failed to deallocate grid%track_old_lat. ') endif ENDIF IF ( ASSOCIATED( grid%track_old_ntsd ) ) THEN DEALLOCATE(grid%track_old_ntsd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2145,& 'frame/module_domain.f: Failed to deallocate grid%track_old_ntsd. ') endif ENDIF IF ( ASSOCIATED( grid%tracker_fixes ) ) THEN DEALLOCATE(grid%tracker_fixes,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2152,& 'frame/module_domain.f: Failed to deallocate grid%tracker_fixes. ') endif ENDIF IF ( ASSOCIATED( grid%membrane_mslp ) ) THEN DEALLOCATE(grid%membrane_mslp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2159,& 'frame/module_domain.f: Failed to deallocate grid%membrane_mslp. ') endif ENDIF IF ( ASSOCIATED( grid%p850rv ) ) THEN DEALLOCATE(grid%p850rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2166,& 'frame/module_domain.f: Failed to deallocate grid%p850rv. ') endif ENDIF IF ( ASSOCIATED( grid%p700rv ) ) THEN DEALLOCATE(grid%p700rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2173,& 'frame/module_domain.f: Failed to deallocate grid%p700rv. ') endif ENDIF IF ( ASSOCIATED( grid%p850wind ) ) THEN DEALLOCATE(grid%p850wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2180,& 'frame/module_domain.f: Failed to deallocate grid%p850wind. ') endif ENDIF IF ( ASSOCIATED( grid%p700wind ) ) THEN DEALLOCATE(grid%p700wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2187,& 'frame/module_domain.f: Failed to deallocate grid%p700wind. ') endif ENDIF IF ( ASSOCIATED( grid%p500u ) ) THEN DEALLOCATE(grid%p500u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2194,& 'frame/module_domain.f: Failed to deallocate grid%p500u. ') endif ENDIF IF ( ASSOCIATED( grid%p500v ) ) THEN DEALLOCATE(grid%p500v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2201,& 'frame/module_domain.f: Failed to deallocate grid%p500v. ') endif ENDIF IF ( ASSOCIATED( grid%p700u ) ) THEN DEALLOCATE(grid%p700u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2208,& 'frame/module_domain.f: Failed to deallocate grid%p700u. ') endif ENDIF IF ( ASSOCIATED( grid%p700v ) ) THEN DEALLOCATE(grid%p700v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2215,& 'frame/module_domain.f: Failed to deallocate grid%p700v. ') endif ENDIF IF ( ASSOCIATED( grid%p850u ) ) THEN DEALLOCATE(grid%p850u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2222,& 'frame/module_domain.f: Failed to deallocate grid%p850u. ') endif ENDIF IF ( ASSOCIATED( grid%p850v ) ) THEN DEALLOCATE(grid%p850v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2229,& 'frame/module_domain.f: Failed to deallocate grid%p850v. ') endif ENDIF IF ( ASSOCIATED( grid%p850z ) ) THEN DEALLOCATE(grid%p850z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2236,& 'frame/module_domain.f: Failed to deallocate grid%p850z. ') endif ENDIF IF ( ASSOCIATED( grid%p700z ) ) THEN DEALLOCATE(grid%p700z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2243,& 'frame/module_domain.f: Failed to deallocate grid%p700z. ') endif ENDIF IF ( ASSOCIATED( grid%m10wind ) ) THEN DEALLOCATE(grid%m10wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2250,& 'frame/module_domain.f: Failed to deallocate grid%m10wind. ') endif ENDIF IF ( ASSOCIATED( grid%m10rv ) ) THEN DEALLOCATE(grid%m10rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2257,& 'frame/module_domain.f: Failed to deallocate grid%m10rv. ') endif ENDIF IF ( ASSOCIATED( grid%sp850rv ) ) THEN DEALLOCATE(grid%sp850rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2264,& 'frame/module_domain.f: Failed to deallocate grid%sp850rv. ') endif ENDIF IF ( ASSOCIATED( grid%sp700rv ) ) THEN DEALLOCATE(grid%sp700rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2271,& 'frame/module_domain.f: Failed to deallocate grid%sp700rv. ') endif ENDIF IF ( ASSOCIATED( grid%sp850wind ) ) THEN DEALLOCATE(grid%sp850wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2278,& 'frame/module_domain.f: Failed to deallocate grid%sp850wind. ') endif ENDIF IF ( ASSOCIATED( grid%sp700wind ) ) THEN DEALLOCATE(grid%sp700wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2285,& 'frame/module_domain.f: Failed to deallocate grid%sp700wind. ') endif ENDIF IF ( ASSOCIATED( grid%sp850z ) ) THEN DEALLOCATE(grid%sp850z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2292,& 'frame/module_domain.f: Failed to deallocate grid%sp850z. ') endif ENDIF IF ( ASSOCIATED( grid%sp700z ) ) THEN DEALLOCATE(grid%sp700z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2299,& 'frame/module_domain.f: Failed to deallocate grid%sp700z. ') endif ENDIF IF ( ASSOCIATED( grid%sm10wind ) ) THEN DEALLOCATE(grid%sm10wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2306,& 'frame/module_domain.f: Failed to deallocate grid%sm10wind. ') endif ENDIF IF ( ASSOCIATED( grid%sm10rv ) ) THEN DEALLOCATE(grid%sm10rv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2313,& 'frame/module_domain.f: Failed to deallocate grid%sm10rv. ') endif ENDIF IF ( ASSOCIATED( grid%smslp ) ) THEN DEALLOCATE(grid%smslp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2320,& 'frame/module_domain.f: Failed to deallocate grid%smslp. ') endif ENDIF IF ( ASSOCIATED( grid%distsq ) ) THEN DEALLOCATE(grid%distsq,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2327,& 'frame/module_domain.f: Failed to deallocate grid%distsq. ') endif ENDIF IF ( ASSOCIATED( grid%weightout ) ) THEN DEALLOCATE(grid%weightout,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2334,& 'frame/module_domain.f: Failed to deallocate grid%weightout. ') endif ENDIF IF ( ASSOCIATED( grid%mslp_noisy ) ) THEN DEALLOCATE(grid%mslp_noisy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2341,& 'frame/module_domain.f: Failed to deallocate grid%mslp_noisy. ') endif ENDIF IF ( ASSOCIATED( grid%pdyn_smooth ) ) THEN DEALLOCATE(grid%pdyn_smooth,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2348,& 'frame/module_domain.f: Failed to deallocate grid%pdyn_smooth. ') endif ENDIF IF ( ASSOCIATED( grid%pdyn_parent ) ) THEN DEALLOCATE(grid%pdyn_parent,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2355,& 'frame/module_domain.f: Failed to deallocate grid%pdyn_parent. ') endif ENDIF IF ( ASSOCIATED( grid%pdyn ) ) THEN DEALLOCATE(grid%pdyn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2362,& 'frame/module_domain.f: Failed to deallocate grid%pdyn. ') endif ENDIF IF ( ASSOCIATED( grid%mslp ) ) THEN DEALLOCATE(grid%mslp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2369,& 'frame/module_domain.f: Failed to deallocate grid%mslp. ') endif ENDIF IF ( ASSOCIATED( grid%best_mslp ) ) THEN DEALLOCATE(grid%best_mslp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2376,& 'frame/module_domain.f: Failed to deallocate grid%best_mslp. ') endif ENDIF IF ( ASSOCIATED( grid%sqws ) ) THEN DEALLOCATE(grid%sqws,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2383,& 'frame/module_domain.f: Failed to deallocate grid%sqws. ') endif ENDIF IF ( ASSOCIATED( grid%ducudt ) ) THEN DEALLOCATE(grid%ducudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2390,& 'frame/module_domain.f: Failed to deallocate grid%ducudt. ') endif ENDIF IF ( ASSOCIATED( grid%dvcudt ) ) THEN DEALLOCATE(grid%dvcudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2397,& 'frame/module_domain.f: Failed to deallocate grid%dvcudt. ') endif ENDIF IF ( ASSOCIATED( grid%randstate1 ) ) THEN DEALLOCATE(grid%randstate1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2404,& 'frame/module_domain.f: Failed to deallocate grid%randstate1. ') endif ENDIF IF ( ASSOCIATED( grid%randstate2 ) ) THEN DEALLOCATE(grid%randstate2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2411,& 'frame/module_domain.f: Failed to deallocate grid%randstate2. ') endif ENDIF IF ( ASSOCIATED( grid%randstate3 ) ) THEN DEALLOCATE(grid%randstate3,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2418,& 'frame/module_domain.f: Failed to deallocate grid%randstate3. ') endif ENDIF IF ( ASSOCIATED( grid%randstate4 ) ) THEN DEALLOCATE(grid%randstate4,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2425,& 'frame/module_domain.f: Failed to deallocate grid%randstate4. ') endif ENDIF IF ( ASSOCIATED( grid%random ) ) THEN DEALLOCATE(grid%random,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2432,& 'frame/module_domain.f: Failed to deallocate grid%random. ') endif ENDIF IF ( ASSOCIATED( grid%iih ) ) THEN DEALLOCATE(grid%iih,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2439,& 'frame/module_domain.f: Failed to deallocate grid%iih. ') endif ENDIF IF ( ASSOCIATED( grid%jjh ) ) THEN DEALLOCATE(grid%jjh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2446,& 'frame/module_domain.f: Failed to deallocate grid%jjh. ') endif ENDIF IF ( ASSOCIATED( grid%iiv ) ) THEN DEALLOCATE(grid%iiv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2453,& 'frame/module_domain.f: Failed to deallocate grid%iiv. ') endif ENDIF IF ( ASSOCIATED( grid%jjv ) ) THEN DEALLOCATE(grid%jjv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2460,& 'frame/module_domain.f: Failed to deallocate grid%jjv. ') endif ENDIF IF ( ASSOCIATED( grid%hnear_i ) ) THEN DEALLOCATE(grid%hnear_i,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2467,& 'frame/module_domain.f: Failed to deallocate grid%hnear_i. ') endif ENDIF IF ( ASSOCIATED( grid%hnear_j ) ) THEN DEALLOCATE(grid%hnear_j,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2474,& 'frame/module_domain.f: Failed to deallocate grid%hnear_j. ') endif ENDIF IF ( ASSOCIATED( grid%hbwgt1 ) ) THEN DEALLOCATE(grid%hbwgt1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2481,& 'frame/module_domain.f: Failed to deallocate grid%hbwgt1. ') endif ENDIF IF ( ASSOCIATED( grid%hbwgt2 ) ) THEN DEALLOCATE(grid%hbwgt2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2488,& 'frame/module_domain.f: Failed to deallocate grid%hbwgt2. ') endif ENDIF IF ( ASSOCIATED( grid%hbwgt3 ) ) THEN DEALLOCATE(grid%hbwgt3,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2495,& 'frame/module_domain.f: Failed to deallocate grid%hbwgt3. ') endif ENDIF IF ( ASSOCIATED( grid%hbwgt4 ) ) THEN DEALLOCATE(grid%hbwgt4,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2502,& 'frame/module_domain.f: Failed to deallocate grid%hbwgt4. ') endif ENDIF IF ( ASSOCIATED( grid%vbwgt1 ) ) THEN DEALLOCATE(grid%vbwgt1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2509,& 'frame/module_domain.f: Failed to deallocate grid%vbwgt1. ') endif ENDIF IF ( ASSOCIATED( grid%vbwgt2 ) ) THEN DEALLOCATE(grid%vbwgt2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2516,& 'frame/module_domain.f: Failed to deallocate grid%vbwgt2. ') endif ENDIF IF ( ASSOCIATED( grid%vbwgt3 ) ) THEN DEALLOCATE(grid%vbwgt3,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2523,& 'frame/module_domain.f: Failed to deallocate grid%vbwgt3. ') endif ENDIF IF ( ASSOCIATED( grid%vbwgt4 ) ) THEN DEALLOCATE(grid%vbwgt4,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2530,& 'frame/module_domain.f: Failed to deallocate grid%vbwgt4. ') endif ENDIF IF ( ASSOCIATED( grid%hlon ) ) THEN DEALLOCATE(grid%hlon,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2537,& 'frame/module_domain.f: Failed to deallocate grid%hlon. ') endif ENDIF IF ( ASSOCIATED( grid%hlat ) ) THEN DEALLOCATE(grid%hlat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2544,& 'frame/module_domain.f: Failed to deallocate grid%hlat. ') endif ENDIF IF ( ASSOCIATED( grid%vlon ) ) THEN DEALLOCATE(grid%vlon,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2551,& 'frame/module_domain.f: Failed to deallocate grid%vlon. ') endif ENDIF IF ( ASSOCIATED( grid%vlat ) ) THEN DEALLOCATE(grid%vlat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2558,& 'frame/module_domain.f: Failed to deallocate grid%vlat. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_m10wind ) ) THEN DEALLOCATE(grid%tg_max_m10wind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2565,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_m10wind. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_wwind ) ) THEN DEALLOCATE(grid%tg_max_wwind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2572,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_wwind. ') endif ENDIF IF ( ASSOCIATED( grid%tg_min_wwind ) ) THEN DEALLOCATE(grid%tg_min_wwind,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2579,& 'frame/module_domain.f: Failed to deallocate grid%tg_min_wwind. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_zhel_25 ) ) THEN DEALLOCATE(grid%tg_max_zhel_25,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2586,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_zhel_25. ') endif ENDIF IF ( ASSOCIATED( grid%tg_min_zhel_25 ) ) THEN DEALLOCATE(grid%tg_min_zhel_25,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2593,& 'frame/module_domain.f: Failed to deallocate grid%tg_min_zhel_25. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_zhel_03 ) ) THEN DEALLOCATE(grid%tg_max_zhel_03,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2600,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_zhel_03. ') endif ENDIF IF ( ASSOCIATED( grid%tg_min_zhel_03 ) ) THEN DEALLOCATE(grid%tg_min_zhel_03,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2607,& 'frame/module_domain.f: Failed to deallocate grid%tg_min_zhel_03. ') endif ENDIF IF ( ASSOCIATED( grid%tg_updhel25 ) ) THEN DEALLOCATE(grid%tg_updhel25,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2614,& 'frame/module_domain.f: Failed to deallocate grid%tg_updhel25. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_updhel25 ) ) THEN DEALLOCATE(grid%tg_max_updhel25,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2621,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_updhel25. ') endif ENDIF IF ( ASSOCIATED( grid%tg_updhel03 ) ) THEN DEALLOCATE(grid%tg_updhel03,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2628,& 'frame/module_domain.f: Failed to deallocate grid%tg_updhel03. ') endif ENDIF IF ( ASSOCIATED( grid%tg_max_updhel03 ) ) THEN DEALLOCATE(grid%tg_max_updhel03,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2635,& 'frame/module_domain.f: Failed to deallocate grid%tg_max_updhel03. ') endif ENDIF IF ( ASSOCIATED( grid%tg_total_precip ) ) THEN DEALLOCATE(grid%tg_total_precip,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2642,& 'frame/module_domain.f: Failed to deallocate grid%tg_total_precip. ') endif ENDIF IF ( ASSOCIATED( grid%tlow ) ) THEN DEALLOCATE(grid%tlow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2649,& 'frame/module_domain.f: Failed to deallocate grid%tlow. ') endif ENDIF IF ( ASSOCIATED( grid%zlow ) ) THEN DEALLOCATE(grid%zlow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2656,& 'frame/module_domain.f: Failed to deallocate grid%zlow. ') endif ENDIF IF ( ASSOCIATED( grid%rotangle ) ) THEN DEALLOCATE(grid%rotangle,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2663,& 'frame/module_domain.f: Failed to deallocate grid%rotangle. ') endif ENDIF IF ( ASSOCIATED( grid%pstd ) ) THEN DEALLOCATE(grid%pstd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2670,& 'frame/module_domain.f: Failed to deallocate grid%pstd. ') endif ENDIF IF ( ASSOCIATED( grid%hres_fis ) ) THEN DEALLOCATE(grid%hres_fis,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2677,& 'frame/module_domain.f: Failed to deallocate grid%hres_fis. ') endif ENDIF IF ( ASSOCIATED( grid%hres_avc ) ) THEN DEALLOCATE(grid%hres_avc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2684,& 'frame/module_domain.f: Failed to deallocate grid%hres_avc. ') endif ENDIF IF ( ASSOCIATED( grid%hres_lnd ) ) THEN DEALLOCATE(grid%hres_lnd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2691,& 'frame/module_domain.f: Failed to deallocate grid%hres_lnd. ') endif ENDIF IF ( ASSOCIATED( grid%hbm2 ) ) THEN DEALLOCATE(grid%hbm2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2698,& 'frame/module_domain.f: Failed to deallocate grid%hbm2. ') endif ENDIF IF ( ASSOCIATED( grid%hbm3 ) ) THEN DEALLOCATE(grid%hbm3,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2705,& 'frame/module_domain.f: Failed to deallocate grid%hbm3. ') endif ENDIF IF ( ASSOCIATED( grid%vbm2 ) ) THEN DEALLOCATE(grid%vbm2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2712,& 'frame/module_domain.f: Failed to deallocate grid%vbm2. ') endif ENDIF IF ( ASSOCIATED( grid%vbm3 ) ) THEN DEALLOCATE(grid%vbm3,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2719,& 'frame/module_domain.f: Failed to deallocate grid%vbm3. ') endif ENDIF IF ( ASSOCIATED( grid%sm ) ) THEN DEALLOCATE(grid%sm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2726,& 'frame/module_domain.f: Failed to deallocate grid%sm. ') endif ENDIF IF ( ASSOCIATED( grid%sm_bxs ) ) THEN DEALLOCATE(grid%sm_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2733,& 'frame/module_domain.f: Failed to deallocate grid%sm_bxs. ') endif NULLIFY(grid%sm_bxs) ENDIF IF ( ASSOCIATED( grid%sm_bxe ) ) THEN DEALLOCATE(grid%sm_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2741,& 'frame/module_domain.f: Failed to deallocate grid%sm_bxe. ') endif NULLIFY(grid%sm_bxe) ENDIF IF ( ASSOCIATED( grid%sm_bys ) ) THEN DEALLOCATE(grid%sm_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2749,& 'frame/module_domain.f: Failed to deallocate grid%sm_bys. ') endif NULLIFY(grid%sm_bys) ENDIF IF ( ASSOCIATED( grid%sm_bye ) ) THEN DEALLOCATE(grid%sm_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2757,& 'frame/module_domain.f: Failed to deallocate grid%sm_bye. ') endif NULLIFY(grid%sm_bye) ENDIF IF ( ASSOCIATED( grid%sm_btxs ) ) THEN DEALLOCATE(grid%sm_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2765,& 'frame/module_domain.f: Failed to deallocate grid%sm_btxs. ') endif NULLIFY(grid%sm_btxs) ENDIF IF ( ASSOCIATED( grid%sm_btxe ) ) THEN DEALLOCATE(grid%sm_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2773,& 'frame/module_domain.f: Failed to deallocate grid%sm_btxe. ') endif NULLIFY(grid%sm_btxe) ENDIF IF ( ASSOCIATED( grid%sm_btys ) ) THEN DEALLOCATE(grid%sm_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2781,& 'frame/module_domain.f: Failed to deallocate grid%sm_btys. ') endif NULLIFY(grid%sm_btys) ENDIF IF ( ASSOCIATED( grid%sm_btye ) ) THEN DEALLOCATE(grid%sm_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2789,& 'frame/module_domain.f: Failed to deallocate grid%sm_btye. ') endif NULLIFY(grid%sm_btye) ENDIF IF ( ASSOCIATED( grid%sice ) ) THEN DEALLOCATE(grid%sice,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2797,& 'frame/module_domain.f: Failed to deallocate grid%sice. ') endif ENDIF IF ( ASSOCIATED( grid%pd ) ) THEN DEALLOCATE(grid%pd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2804,& 'frame/module_domain.f: Failed to deallocate grid%pd. ') endif ENDIF IF ( ASSOCIATED( grid%pd_bxs ) ) THEN DEALLOCATE(grid%pd_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2811,& 'frame/module_domain.f: Failed to deallocate grid%pd_bxs. ') endif NULLIFY(grid%pd_bxs) ENDIF IF ( ASSOCIATED( grid%pd_bxe ) ) THEN DEALLOCATE(grid%pd_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2819,& 'frame/module_domain.f: Failed to deallocate grid%pd_bxe. ') endif NULLIFY(grid%pd_bxe) ENDIF IF ( ASSOCIATED( grid%pd_bys ) ) THEN DEALLOCATE(grid%pd_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2827,& 'frame/module_domain.f: Failed to deallocate grid%pd_bys. ') endif NULLIFY(grid%pd_bys) ENDIF IF ( ASSOCIATED( grid%pd_bye ) ) THEN DEALLOCATE(grid%pd_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2835,& 'frame/module_domain.f: Failed to deallocate grid%pd_bye. ') endif NULLIFY(grid%pd_bye) ENDIF IF ( ASSOCIATED( grid%pd_btxs ) ) THEN DEALLOCATE(grid%pd_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2843,& 'frame/module_domain.f: Failed to deallocate grid%pd_btxs. ') endif NULLIFY(grid%pd_btxs) ENDIF IF ( ASSOCIATED( grid%pd_btxe ) ) THEN DEALLOCATE(grid%pd_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2851,& 'frame/module_domain.f: Failed to deallocate grid%pd_btxe. ') endif NULLIFY(grid%pd_btxe) ENDIF IF ( ASSOCIATED( grid%pd_btys ) ) THEN DEALLOCATE(grid%pd_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2859,& 'frame/module_domain.f: Failed to deallocate grid%pd_btys. ') endif NULLIFY(grid%pd_btys) ENDIF IF ( ASSOCIATED( grid%pd_btye ) ) THEN DEALLOCATE(grid%pd_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2867,& 'frame/module_domain.f: Failed to deallocate grid%pd_btye. ') endif NULLIFY(grid%pd_btye) ENDIF IF ( ASSOCIATED( grid%fis ) ) THEN DEALLOCATE(grid%fis,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2875,& 'frame/module_domain.f: Failed to deallocate grid%fis. ') endif ENDIF IF ( ASSOCIATED( grid%res ) ) THEN DEALLOCATE(grid%res,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2882,& 'frame/module_domain.f: Failed to deallocate grid%res. ') endif ENDIF IF ( ASSOCIATED( grid%t ) ) THEN DEALLOCATE(grid%t,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2889,& 'frame/module_domain.f: Failed to deallocate grid%t. ') endif ENDIF IF ( ASSOCIATED( grid%t_bxs ) ) THEN DEALLOCATE(grid%t_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2896,& 'frame/module_domain.f: Failed to deallocate grid%t_bxs. ') endif NULLIFY(grid%t_bxs) ENDIF IF ( ASSOCIATED( grid%t_bxe ) ) THEN DEALLOCATE(grid%t_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2904,& 'frame/module_domain.f: Failed to deallocate grid%t_bxe. ') endif NULLIFY(grid%t_bxe) ENDIF IF ( ASSOCIATED( grid%t_bys ) ) THEN DEALLOCATE(grid%t_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2912,& 'frame/module_domain.f: Failed to deallocate grid%t_bys. ') endif NULLIFY(grid%t_bys) ENDIF IF ( ASSOCIATED( grid%t_bye ) ) THEN DEALLOCATE(grid%t_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2920,& 'frame/module_domain.f: Failed to deallocate grid%t_bye. ') endif NULLIFY(grid%t_bye) ENDIF IF ( ASSOCIATED( grid%t_btxs ) ) THEN DEALLOCATE(grid%t_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2928,& 'frame/module_domain.f: Failed to deallocate grid%t_btxs. ') endif NULLIFY(grid%t_btxs) ENDIF IF ( ASSOCIATED( grid%t_btxe ) ) THEN DEALLOCATE(grid%t_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2936,& 'frame/module_domain.f: Failed to deallocate grid%t_btxe. ') endif NULLIFY(grid%t_btxe) ENDIF IF ( ASSOCIATED( grid%t_btys ) ) THEN DEALLOCATE(grid%t_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2944,& 'frame/module_domain.f: Failed to deallocate grid%t_btys. ') endif NULLIFY(grid%t_btys) ENDIF IF ( ASSOCIATED( grid%t_btye ) ) THEN DEALLOCATE(grid%t_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2952,& 'frame/module_domain.f: Failed to deallocate grid%t_btye. ') endif NULLIFY(grid%t_btye) ENDIF IF ( ASSOCIATED( grid%q ) ) THEN DEALLOCATE(grid%q,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2960,& 'frame/module_domain.f: Failed to deallocate grid%q. ') endif ENDIF IF ( ASSOCIATED( grid%q_bxs ) ) THEN DEALLOCATE(grid%q_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2967,& 'frame/module_domain.f: Failed to deallocate grid%q_bxs. ') endif NULLIFY(grid%q_bxs) ENDIF IF ( ASSOCIATED( grid%q_bxe ) ) THEN DEALLOCATE(grid%q_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2975,& 'frame/module_domain.f: Failed to deallocate grid%q_bxe. ') endif NULLIFY(grid%q_bxe) ENDIF IF ( ASSOCIATED( grid%q_bys ) ) THEN DEALLOCATE(grid%q_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2983,& 'frame/module_domain.f: Failed to deallocate grid%q_bys. ') endif NULLIFY(grid%q_bys) ENDIF IF ( ASSOCIATED( grid%q_bye ) ) THEN DEALLOCATE(grid%q_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2991,& 'frame/module_domain.f: Failed to deallocate grid%q_bye. ') endif NULLIFY(grid%q_bye) ENDIF IF ( ASSOCIATED( grid%q_btxs ) ) THEN DEALLOCATE(grid%q_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",2999,& 'frame/module_domain.f: Failed to deallocate grid%q_btxs. ') endif NULLIFY(grid%q_btxs) ENDIF IF ( ASSOCIATED( grid%q_btxe ) ) THEN DEALLOCATE(grid%q_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3007,& 'frame/module_domain.f: Failed to deallocate grid%q_btxe. ') endif NULLIFY(grid%q_btxe) ENDIF IF ( ASSOCIATED( grid%q_btys ) ) THEN DEALLOCATE(grid%q_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3015,& 'frame/module_domain.f: Failed to deallocate grid%q_btys. ') endif NULLIFY(grid%q_btys) ENDIF IF ( ASSOCIATED( grid%q_btye ) ) THEN DEALLOCATE(grid%q_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3023,& 'frame/module_domain.f: Failed to deallocate grid%q_btye. ') endif NULLIFY(grid%q_btye) ENDIF IF ( ASSOCIATED( grid%test_vgrid ) ) THEN DEALLOCATE(grid%test_vgrid,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3031,& 'frame/module_domain.f: Failed to deallocate grid%test_vgrid. ') endif ENDIF IF ( ASSOCIATED( grid%u ) ) THEN DEALLOCATE(grid%u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3038,& 'frame/module_domain.f: Failed to deallocate grid%u. ') endif ENDIF IF ( ASSOCIATED( grid%u_bxs ) ) THEN DEALLOCATE(grid%u_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3045,& 'frame/module_domain.f: Failed to deallocate grid%u_bxs. ') endif NULLIFY(grid%u_bxs) ENDIF IF ( ASSOCIATED( grid%u_bxe ) ) THEN DEALLOCATE(grid%u_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3053,& 'frame/module_domain.f: Failed to deallocate grid%u_bxe. ') endif NULLIFY(grid%u_bxe) ENDIF IF ( ASSOCIATED( grid%u_bys ) ) THEN DEALLOCATE(grid%u_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3061,& 'frame/module_domain.f: Failed to deallocate grid%u_bys. ') endif NULLIFY(grid%u_bys) ENDIF IF ( ASSOCIATED( grid%u_bye ) ) THEN DEALLOCATE(grid%u_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3069,& 'frame/module_domain.f: Failed to deallocate grid%u_bye. ') endif NULLIFY(grid%u_bye) ENDIF IF ( ASSOCIATED( grid%u_btxs ) ) THEN DEALLOCATE(grid%u_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3077,& 'frame/module_domain.f: Failed to deallocate grid%u_btxs. ') endif NULLIFY(grid%u_btxs) ENDIF IF ( ASSOCIATED( grid%u_btxe ) ) THEN DEALLOCATE(grid%u_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3085,& 'frame/module_domain.f: Failed to deallocate grid%u_btxe. ') endif NULLIFY(grid%u_btxe) ENDIF IF ( ASSOCIATED( grid%u_btys ) ) THEN DEALLOCATE(grid%u_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3093,& 'frame/module_domain.f: Failed to deallocate grid%u_btys. ') endif NULLIFY(grid%u_btys) ENDIF IF ( ASSOCIATED( grid%u_btye ) ) THEN DEALLOCATE(grid%u_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3101,& 'frame/module_domain.f: Failed to deallocate grid%u_btye. ') endif NULLIFY(grid%u_btye) ENDIF IF ( ASSOCIATED( grid%v ) ) THEN DEALLOCATE(grid%v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3109,& 'frame/module_domain.f: Failed to deallocate grid%v. ') endif ENDIF IF ( ASSOCIATED( grid%v_bxs ) ) THEN DEALLOCATE(grid%v_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3116,& 'frame/module_domain.f: Failed to deallocate grid%v_bxs. ') endif NULLIFY(grid%v_bxs) ENDIF IF ( ASSOCIATED( grid%v_bxe ) ) THEN DEALLOCATE(grid%v_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3124,& 'frame/module_domain.f: Failed to deallocate grid%v_bxe. ') endif NULLIFY(grid%v_bxe) ENDIF IF ( ASSOCIATED( grid%v_bys ) ) THEN DEALLOCATE(grid%v_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3132,& 'frame/module_domain.f: Failed to deallocate grid%v_bys. ') endif NULLIFY(grid%v_bys) ENDIF IF ( ASSOCIATED( grid%v_bye ) ) THEN DEALLOCATE(grid%v_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3140,& 'frame/module_domain.f: Failed to deallocate grid%v_bye. ') endif NULLIFY(grid%v_bye) ENDIF IF ( ASSOCIATED( grid%v_btxs ) ) THEN DEALLOCATE(grid%v_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3148,& 'frame/module_domain.f: Failed to deallocate grid%v_btxs. ') endif NULLIFY(grid%v_btxs) ENDIF IF ( ASSOCIATED( grid%v_btxe ) ) THEN DEALLOCATE(grid%v_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3156,& 'frame/module_domain.f: Failed to deallocate grid%v_btxe. ') endif NULLIFY(grid%v_btxe) ENDIF IF ( ASSOCIATED( grid%v_btys ) ) THEN DEALLOCATE(grid%v_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3164,& 'frame/module_domain.f: Failed to deallocate grid%v_btys. ') endif NULLIFY(grid%v_btys) ENDIF IF ( ASSOCIATED( grid%v_btye ) ) THEN DEALLOCATE(grid%v_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3172,& 'frame/module_domain.f: Failed to deallocate grid%v_btye. ') endif NULLIFY(grid%v_btye) ENDIF IF ( ASSOCIATED( grid%told ) ) THEN DEALLOCATE(grid%told,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3180,& 'frame/module_domain.f: Failed to deallocate grid%told. ') endif ENDIF IF ( ASSOCIATED( grid%uold ) ) THEN DEALLOCATE(grid%uold,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3187,& 'frame/module_domain.f: Failed to deallocate grid%uold. ') endif ENDIF IF ( ASSOCIATED( grid%vold ) ) THEN DEALLOCATE(grid%vold,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3194,& 'frame/module_domain.f: Failed to deallocate grid%vold. ') endif ENDIF IF ( ASSOCIATED( grid%hcoeff ) ) THEN DEALLOCATE(grid%hcoeff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3201,& 'frame/module_domain.f: Failed to deallocate grid%hcoeff. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_pd ) ) THEN DEALLOCATE(grid%dfi_pd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3208,& 'frame/module_domain.f: Failed to deallocate grid%dfi_pd. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_pint ) ) THEN DEALLOCATE(grid%dfi_pint,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3215,& 'frame/module_domain.f: Failed to deallocate grid%dfi_pint. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_dwdt ) ) THEN DEALLOCATE(grid%dfi_dwdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3222,& 'frame/module_domain.f: Failed to deallocate grid%dfi_dwdt. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_t ) ) THEN DEALLOCATE(grid%dfi_t,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3229,& 'frame/module_domain.f: Failed to deallocate grid%dfi_t. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_q ) ) THEN DEALLOCATE(grid%dfi_q,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3236,& 'frame/module_domain.f: Failed to deallocate grid%dfi_q. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_u ) ) THEN DEALLOCATE(grid%dfi_u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3243,& 'frame/module_domain.f: Failed to deallocate grid%dfi_u. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_v ) ) THEN DEALLOCATE(grid%dfi_v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3250,& 'frame/module_domain.f: Failed to deallocate grid%dfi_v. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_q2 ) ) THEN DEALLOCATE(grid%dfi_q2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3257,& 'frame/module_domain.f: Failed to deallocate grid%dfi_q2. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_cwm ) ) THEN DEALLOCATE(grid%dfi_cwm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3264,& 'frame/module_domain.f: Failed to deallocate grid%dfi_cwm. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_rrw ) ) THEN DEALLOCATE(grid%dfi_rrw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3271,& 'frame/module_domain.f: Failed to deallocate grid%dfi_rrw. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_stc ) ) THEN DEALLOCATE(grid%dfi_stc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3278,& 'frame/module_domain.f: Failed to deallocate grid%dfi_stc. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_smc ) ) THEN DEALLOCATE(grid%dfi_smc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3285,& 'frame/module_domain.f: Failed to deallocate grid%dfi_smc. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_sh2o ) ) THEN DEALLOCATE(grid%dfi_sh2o,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3292,& 'frame/module_domain.f: Failed to deallocate grid%dfi_sh2o. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_snow ) ) THEN DEALLOCATE(grid%dfi_snow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3299,& 'frame/module_domain.f: Failed to deallocate grid%dfi_snow. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_snowh ) ) THEN DEALLOCATE(grid%dfi_snowh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3306,& 'frame/module_domain.f: Failed to deallocate grid%dfi_snowh. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_canwat ) ) THEN DEALLOCATE(grid%dfi_canwat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3313,& 'frame/module_domain.f: Failed to deallocate grid%dfi_canwat. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_nmm_tsk ) ) THEN DEALLOCATE(grid%dfi_nmm_tsk,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3320,& 'frame/module_domain.f: Failed to deallocate grid%dfi_nmm_tsk. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_snowc ) ) THEN DEALLOCATE(grid%dfi_snowc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3327,& 'frame/module_domain.f: Failed to deallocate grid%dfi_snowc. ') endif ENDIF IF ( ASSOCIATED( grid%dx_nmm ) ) THEN DEALLOCATE(grid%dx_nmm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3334,& 'frame/module_domain.f: Failed to deallocate grid%dx_nmm. ') endif ENDIF IF ( ASSOCIATED( grid%wpdar ) ) THEN DEALLOCATE(grid%wpdar,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3341,& 'frame/module_domain.f: Failed to deallocate grid%wpdar. ') endif ENDIF IF ( ASSOCIATED( grid%cpgfu ) ) THEN DEALLOCATE(grid%cpgfu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3348,& 'frame/module_domain.f: Failed to deallocate grid%cpgfu. ') endif ENDIF IF ( ASSOCIATED( grid%curv ) ) THEN DEALLOCATE(grid%curv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3355,& 'frame/module_domain.f: Failed to deallocate grid%curv. ') endif ENDIF IF ( ASSOCIATED( grid%fcp ) ) THEN DEALLOCATE(grid%fcp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3362,& 'frame/module_domain.f: Failed to deallocate grid%fcp. ') endif ENDIF IF ( ASSOCIATED( grid%fdiv ) ) THEN DEALLOCATE(grid%fdiv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3369,& 'frame/module_domain.f: Failed to deallocate grid%fdiv. ') endif ENDIF IF ( ASSOCIATED( grid%f ) ) THEN DEALLOCATE(grid%f,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3376,& 'frame/module_domain.f: Failed to deallocate grid%f. ') endif ENDIF IF ( ASSOCIATED( grid%fad ) ) THEN DEALLOCATE(grid%fad,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3383,& 'frame/module_domain.f: Failed to deallocate grid%fad. ') endif ENDIF IF ( ASSOCIATED( grid%ddmpu ) ) THEN DEALLOCATE(grid%ddmpu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3390,& 'frame/module_domain.f: Failed to deallocate grid%ddmpu. ') endif ENDIF IF ( ASSOCIATED( grid%ddmpv ) ) THEN DEALLOCATE(grid%ddmpv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3397,& 'frame/module_domain.f: Failed to deallocate grid%ddmpv. ') endif ENDIF IF ( ASSOCIATED( grid%deta ) ) THEN DEALLOCATE(grid%deta,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3404,& 'frame/module_domain.f: Failed to deallocate grid%deta. ') endif ENDIF IF ( ASSOCIATED( grid%rdeta ) ) THEN DEALLOCATE(grid%rdeta,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3411,& 'frame/module_domain.f: Failed to deallocate grid%rdeta. ') endif ENDIF IF ( ASSOCIATED( grid%aeta ) ) THEN DEALLOCATE(grid%aeta,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3418,& 'frame/module_domain.f: Failed to deallocate grid%aeta. ') endif ENDIF IF ( ASSOCIATED( grid%f4q2 ) ) THEN DEALLOCATE(grid%f4q2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3425,& 'frame/module_domain.f: Failed to deallocate grid%f4q2. ') endif ENDIF IF ( ASSOCIATED( grid%etax ) ) THEN DEALLOCATE(grid%etax,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3432,& 'frame/module_domain.f: Failed to deallocate grid%etax. ') endif ENDIF IF ( ASSOCIATED( grid%dfl ) ) THEN DEALLOCATE(grid%dfl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3439,& 'frame/module_domain.f: Failed to deallocate grid%dfl. ') endif ENDIF IF ( ASSOCIATED( grid%deta1 ) ) THEN DEALLOCATE(grid%deta1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3446,& 'frame/module_domain.f: Failed to deallocate grid%deta1. ') endif ENDIF IF ( ASSOCIATED( grid%aeta1 ) ) THEN DEALLOCATE(grid%aeta1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3453,& 'frame/module_domain.f: Failed to deallocate grid%aeta1. ') endif ENDIF IF ( ASSOCIATED( grid%eta1 ) ) THEN DEALLOCATE(grid%eta1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3460,& 'frame/module_domain.f: Failed to deallocate grid%eta1. ') endif ENDIF IF ( ASSOCIATED( grid%deta2 ) ) THEN DEALLOCATE(grid%deta2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3467,& 'frame/module_domain.f: Failed to deallocate grid%deta2. ') endif ENDIF IF ( ASSOCIATED( grid%aeta2 ) ) THEN DEALLOCATE(grid%aeta2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3474,& 'frame/module_domain.f: Failed to deallocate grid%aeta2. ') endif ENDIF IF ( ASSOCIATED( grid%eta2 ) ) THEN DEALLOCATE(grid%eta2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3481,& 'frame/module_domain.f: Failed to deallocate grid%eta2. ') endif ENDIF IF ( ASSOCIATED( grid%em ) ) THEN DEALLOCATE(grid%em,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3488,& 'frame/module_domain.f: Failed to deallocate grid%em. ') endif ENDIF IF ( ASSOCIATED( grid%emt ) ) THEN DEALLOCATE(grid%emt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3495,& 'frame/module_domain.f: Failed to deallocate grid%emt. ') endif ENDIF IF ( ASSOCIATED( grid%adt ) ) THEN DEALLOCATE(grid%adt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3502,& 'frame/module_domain.f: Failed to deallocate grid%adt. ') endif ENDIF IF ( ASSOCIATED( grid%adu ) ) THEN DEALLOCATE(grid%adu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3509,& 'frame/module_domain.f: Failed to deallocate grid%adu. ') endif ENDIF IF ( ASSOCIATED( grid%adv ) ) THEN DEALLOCATE(grid%adv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3516,& 'frame/module_domain.f: Failed to deallocate grid%adv. ') endif ENDIF IF ( ASSOCIATED( grid%em_loc ) ) THEN DEALLOCATE(grid%em_loc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3523,& 'frame/module_domain.f: Failed to deallocate grid%em_loc. ') endif ENDIF IF ( ASSOCIATED( grid%emt_loc ) ) THEN DEALLOCATE(grid%emt_loc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3530,& 'frame/module_domain.f: Failed to deallocate grid%emt_loc. ') endif ENDIF IF ( ASSOCIATED( grid%pdsl ) ) THEN DEALLOCATE(grid%pdsl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3537,& 'frame/module_domain.f: Failed to deallocate grid%pdsl. ') endif ENDIF IF ( ASSOCIATED( grid%pdslo ) ) THEN DEALLOCATE(grid%pdslo,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3544,& 'frame/module_domain.f: Failed to deallocate grid%pdslo. ') endif ENDIF IF ( ASSOCIATED( grid%psdt ) ) THEN DEALLOCATE(grid%psdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3551,& 'frame/module_domain.f: Failed to deallocate grid%psdt. ') endif ENDIF IF ( ASSOCIATED( grid%div ) ) THEN DEALLOCATE(grid%div,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3558,& 'frame/module_domain.f: Failed to deallocate grid%div. ') endif ENDIF IF ( ASSOCIATED( grid%def3d ) ) THEN DEALLOCATE(grid%def3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3565,& 'frame/module_domain.f: Failed to deallocate grid%def3d. ') endif ENDIF IF ( ASSOCIATED( grid%few ) ) THEN DEALLOCATE(grid%few,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3572,& 'frame/module_domain.f: Failed to deallocate grid%few. ') endif ENDIF IF ( ASSOCIATED( grid%fne ) ) THEN DEALLOCATE(grid%fne,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3579,& 'frame/module_domain.f: Failed to deallocate grid%fne. ') endif ENDIF IF ( ASSOCIATED( grid%fns ) ) THEN DEALLOCATE(grid%fns,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3586,& 'frame/module_domain.f: Failed to deallocate grid%fns. ') endif ENDIF IF ( ASSOCIATED( grid%fse ) ) THEN DEALLOCATE(grid%fse,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3593,& 'frame/module_domain.f: Failed to deallocate grid%fse. ') endif ENDIF IF ( ASSOCIATED( grid%omgalf ) ) THEN DEALLOCATE(grid%omgalf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3600,& 'frame/module_domain.f: Failed to deallocate grid%omgalf. ') endif ENDIF IF ( ASSOCIATED( grid%petdt ) ) THEN DEALLOCATE(grid%petdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3607,& 'frame/module_domain.f: Failed to deallocate grid%petdt. ') endif ENDIF IF ( ASSOCIATED( grid%rtop ) ) THEN DEALLOCATE(grid%rtop,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3614,& 'frame/module_domain.f: Failed to deallocate grid%rtop. ') endif ENDIF IF ( ASSOCIATED( grid%pblh ) ) THEN DEALLOCATE(grid%pblh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3621,& 'frame/module_domain.f: Failed to deallocate grid%pblh. ') endif ENDIF IF ( ASSOCIATED( grid%lpbl ) ) THEN DEALLOCATE(grid%lpbl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3628,& 'frame/module_domain.f: Failed to deallocate grid%lpbl. ') endif ENDIF IF ( ASSOCIATED( grid%mixht ) ) THEN DEALLOCATE(grid%mixht,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3635,& 'frame/module_domain.f: Failed to deallocate grid%mixht. ') endif ENDIF IF ( ASSOCIATED( grid%ustar ) ) THEN DEALLOCATE(grid%ustar,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3642,& 'frame/module_domain.f: Failed to deallocate grid%ustar. ') endif ENDIF IF ( ASSOCIATED( grid%z0 ) ) THEN DEALLOCATE(grid%z0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3649,& 'frame/module_domain.f: Failed to deallocate grid%z0. ') endif ENDIF IF ( ASSOCIATED( grid%mz0 ) ) THEN DEALLOCATE(grid%mz0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3656,& 'frame/module_domain.f: Failed to deallocate grid%mz0. ') endif ENDIF IF ( ASSOCIATED( grid%scurx ) ) THEN DEALLOCATE(grid%scurx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3663,& 'frame/module_domain.f: Failed to deallocate grid%scurx. ') endif ENDIF IF ( ASSOCIATED( grid%scury ) ) THEN DEALLOCATE(grid%scury,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3670,& 'frame/module_domain.f: Failed to deallocate grid%scury. ') endif ENDIF IF ( ASSOCIATED( grid%charn ) ) THEN DEALLOCATE(grid%charn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3677,& 'frame/module_domain.f: Failed to deallocate grid%charn. ') endif ENDIF IF ( ASSOCIATED( grid%msang ) ) THEN DEALLOCATE(grid%msang,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3684,& 'frame/module_domain.f: Failed to deallocate grid%msang. ') endif ENDIF IF ( ASSOCIATED( grid%rchno ) ) THEN DEALLOCATE(grid%rchno,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3691,& 'frame/module_domain.f: Failed to deallocate grid%rchno. ') endif ENDIF IF ( ASSOCIATED( grid%zsig1 ) ) THEN DEALLOCATE(grid%zsig1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3698,& 'frame/module_domain.f: Failed to deallocate grid%zsig1. ') endif ENDIF IF ( ASSOCIATED( grid%ulowl ) ) THEN DEALLOCATE(grid%ulowl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3705,& 'frame/module_domain.f: Failed to deallocate grid%ulowl. ') endif ENDIF IF ( ASSOCIATED( grid%vlowl ) ) THEN DEALLOCATE(grid%vlowl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3712,& 'frame/module_domain.f: Failed to deallocate grid%vlowl. ') endif ENDIF IF ( ASSOCIATED( grid%rc2d ) ) THEN DEALLOCATE(grid%rc2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3719,& 'frame/module_domain.f: Failed to deallocate grid%rc2d. ') endif ENDIF IF ( ASSOCIATED( grid%dku3d ) ) THEN DEALLOCATE(grid%dku3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3726,& 'frame/module_domain.f: Failed to deallocate grid%dku3d. ') endif ENDIF IF ( ASSOCIATED( grid%dkt3d ) ) THEN DEALLOCATE(grid%dkt3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3733,& 'frame/module_domain.f: Failed to deallocate grid%dkt3d. ') endif ENDIF IF ( ASSOCIATED( grid%scalefun ) ) THEN DEALLOCATE(grid%scalefun,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3740,& 'frame/module_domain.f: Failed to deallocate grid%scalefun. ') endif ENDIF IF ( ASSOCIATED( grid%scalefun1 ) ) THEN DEALLOCATE(grid%scalefun1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3747,& 'frame/module_domain.f: Failed to deallocate grid%scalefun1. ') endif ENDIF IF ( ASSOCIATED( grid%sigmu ) ) THEN DEALLOCATE(grid%sigmu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3754,& 'frame/module_domain.f: Failed to deallocate grid%sigmu. ') endif ENDIF IF ( ASSOCIATED( grid%sigmu1 ) ) THEN DEALLOCATE(grid%sigmu1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3761,& 'frame/module_domain.f: Failed to deallocate grid%sigmu1. ') endif ENDIF IF ( ASSOCIATED( grid%dthcudt ) ) THEN DEALLOCATE(grid%dthcudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3768,& 'frame/module_domain.f: Failed to deallocate grid%dthcudt. ') endif ENDIF IF ( ASSOCIATED( grid%dqvcudt ) ) THEN DEALLOCATE(grid%dqvcudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3775,& 'frame/module_domain.f: Failed to deallocate grid%dqvcudt. ') endif ENDIF IF ( ASSOCIATED( grid%dqrcudt ) ) THEN DEALLOCATE(grid%dqrcudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3782,& 'frame/module_domain.f: Failed to deallocate grid%dqrcudt. ') endif ENDIF IF ( ASSOCIATED( grid%dqccudt ) ) THEN DEALLOCATE(grid%dqccudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3789,& 'frame/module_domain.f: Failed to deallocate grid%dqccudt. ') endif ENDIF IF ( ASSOCIATED( grid%dqicudt ) ) THEN DEALLOCATE(grid%dqicudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3796,& 'frame/module_domain.f: Failed to deallocate grid%dqicudt. ') endif ENDIF IF ( ASSOCIATED( grid%dqscudt ) ) THEN DEALLOCATE(grid%dqscudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3803,& 'frame/module_domain.f: Failed to deallocate grid%dqscudt. ') endif ENDIF IF ( ASSOCIATED( grid%dthbldt ) ) THEN DEALLOCATE(grid%dthbldt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3810,& 'frame/module_domain.f: Failed to deallocate grid%dthbldt. ') endif ENDIF IF ( ASSOCIATED( grid%dqvbldt ) ) THEN DEALLOCATE(grid%dqvbldt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3817,& 'frame/module_domain.f: Failed to deallocate grid%dqvbldt. ') endif ENDIF IF ( ASSOCIATED( grid%dubldt ) ) THEN DEALLOCATE(grid%dubldt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3824,& 'frame/module_domain.f: Failed to deallocate grid%dubldt. ') endif ENDIF IF ( ASSOCIATED( grid%dvbldt ) ) THEN DEALLOCATE(grid%dvbldt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3831,& 'frame/module_domain.f: Failed to deallocate grid%dvbldt. ') endif ENDIF IF ( ASSOCIATED( grid%hpbl2d ) ) THEN DEALLOCATE(grid%hpbl2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3838,& 'frame/module_domain.f: Failed to deallocate grid%hpbl2d. ') endif ENDIF IF ( ASSOCIATED( grid%heat2d ) ) THEN DEALLOCATE(grid%heat2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3845,& 'frame/module_domain.f: Failed to deallocate grid%heat2d. ') endif ENDIF IF ( ASSOCIATED( grid%evap2d ) ) THEN DEALLOCATE(grid%evap2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3852,& 'frame/module_domain.f: Failed to deallocate grid%evap2d. ') endif ENDIF IF ( ASSOCIATED( grid%z0base ) ) THEN DEALLOCATE(grid%z0base,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3859,& 'frame/module_domain.f: Failed to deallocate grid%z0base. ') endif ENDIF IF ( ASSOCIATED( grid%ths ) ) THEN DEALLOCATE(grid%ths,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3866,& 'frame/module_domain.f: Failed to deallocate grid%ths. ') endif ENDIF IF ( ASSOCIATED( grid%mavail ) ) THEN DEALLOCATE(grid%mavail,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3873,& 'frame/module_domain.f: Failed to deallocate grid%mavail. ') endif ENDIF IF ( ASSOCIATED( grid%qsh ) ) THEN DEALLOCATE(grid%qsh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3880,& 'frame/module_domain.f: Failed to deallocate grid%qsh. ') endif ENDIF IF ( ASSOCIATED( grid%twbs ) ) THEN DEALLOCATE(grid%twbs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3887,& 'frame/module_domain.f: Failed to deallocate grid%twbs. ') endif ENDIF IF ( ASSOCIATED( grid%qwbs ) ) THEN DEALLOCATE(grid%qwbs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3894,& 'frame/module_domain.f: Failed to deallocate grid%qwbs. ') endif ENDIF IF ( ASSOCIATED( grid%taux ) ) THEN DEALLOCATE(grid%taux,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3901,& 'frame/module_domain.f: Failed to deallocate grid%taux. ') endif ENDIF IF ( ASSOCIATED( grid%tauy ) ) THEN DEALLOCATE(grid%tauy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3908,& 'frame/module_domain.f: Failed to deallocate grid%tauy. ') endif ENDIF IF ( ASSOCIATED( grid%prec ) ) THEN DEALLOCATE(grid%prec,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3915,& 'frame/module_domain.f: Failed to deallocate grid%prec. ') endif ENDIF IF ( ASSOCIATED( grid%aprec ) ) THEN DEALLOCATE(grid%aprec,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3922,& 'frame/module_domain.f: Failed to deallocate grid%aprec. ') endif ENDIF IF ( ASSOCIATED( grid%acprec ) ) THEN DEALLOCATE(grid%acprec,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3929,& 'frame/module_domain.f: Failed to deallocate grid%acprec. ') endif ENDIF IF ( ASSOCIATED( grid%cuprec ) ) THEN DEALLOCATE(grid%cuprec,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3936,& 'frame/module_domain.f: Failed to deallocate grid%cuprec. ') endif ENDIF IF ( ASSOCIATED( grid%lspa ) ) THEN DEALLOCATE(grid%lspa,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3943,& 'frame/module_domain.f: Failed to deallocate grid%lspa. ') endif ENDIF IF ( ASSOCIATED( grid%ddata ) ) THEN DEALLOCATE(grid%ddata,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3950,& 'frame/module_domain.f: Failed to deallocate grid%ddata. ') endif ENDIF IF ( ASSOCIATED( grid%accliq ) ) THEN DEALLOCATE(grid%accliq,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3957,& 'frame/module_domain.f: Failed to deallocate grid%accliq. ') endif ENDIF IF ( ASSOCIATED( grid%sno ) ) THEN DEALLOCATE(grid%sno,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3964,& 'frame/module_domain.f: Failed to deallocate grid%sno. ') endif ENDIF IF ( ASSOCIATED( grid%si ) ) THEN DEALLOCATE(grid%si,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3971,& 'frame/module_domain.f: Failed to deallocate grid%si. ') endif ENDIF IF ( ASSOCIATED( grid%cldefi ) ) THEN DEALLOCATE(grid%cldefi,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3978,& 'frame/module_domain.f: Failed to deallocate grid%cldefi. ') endif ENDIF IF ( ASSOCIATED( grid%deep ) ) THEN DEALLOCATE(grid%deep,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3985,& 'frame/module_domain.f: Failed to deallocate grid%deep. ') endif ENDIF IF ( ASSOCIATED( grid%rf ) ) THEN DEALLOCATE(grid%rf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3992,& 'frame/module_domain.f: Failed to deallocate grid%rf. ') endif ENDIF IF ( ASSOCIATED( grid%th10 ) ) THEN DEALLOCATE(grid%th10,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",3999,& 'frame/module_domain.f: Failed to deallocate grid%th10. ') endif ENDIF IF ( ASSOCIATED( grid%q10 ) ) THEN DEALLOCATE(grid%q10,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4006,& 'frame/module_domain.f: Failed to deallocate grid%q10. ') endif ENDIF IF ( ASSOCIATED( grid%pshltr ) ) THEN DEALLOCATE(grid%pshltr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4013,& 'frame/module_domain.f: Failed to deallocate grid%pshltr. ') endif ENDIF IF ( ASSOCIATED( grid%tshltr ) ) THEN DEALLOCATE(grid%tshltr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4020,& 'frame/module_domain.f: Failed to deallocate grid%tshltr. ') endif ENDIF IF ( ASSOCIATED( grid%qshltr ) ) THEN DEALLOCATE(grid%qshltr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4027,& 'frame/module_domain.f: Failed to deallocate grid%qshltr. ') endif ENDIF IF ( ASSOCIATED( grid%q2 ) ) THEN DEALLOCATE(grid%q2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4034,& 'frame/module_domain.f: Failed to deallocate grid%q2. ') endif ENDIF IF ( ASSOCIATED( grid%q2_bxs ) ) THEN DEALLOCATE(grid%q2_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4041,& 'frame/module_domain.f: Failed to deallocate grid%q2_bxs. ') endif NULLIFY(grid%q2_bxs) ENDIF IF ( ASSOCIATED( grid%q2_bxe ) ) THEN DEALLOCATE(grid%q2_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4049,& 'frame/module_domain.f: Failed to deallocate grid%q2_bxe. ') endif NULLIFY(grid%q2_bxe) ENDIF IF ( ASSOCIATED( grid%q2_bys ) ) THEN DEALLOCATE(grid%q2_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4057,& 'frame/module_domain.f: Failed to deallocate grid%q2_bys. ') endif NULLIFY(grid%q2_bys) ENDIF IF ( ASSOCIATED( grid%q2_bye ) ) THEN DEALLOCATE(grid%q2_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4065,& 'frame/module_domain.f: Failed to deallocate grid%q2_bye. ') endif NULLIFY(grid%q2_bye) ENDIF IF ( ASSOCIATED( grid%q2_btxs ) ) THEN DEALLOCATE(grid%q2_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4073,& 'frame/module_domain.f: Failed to deallocate grid%q2_btxs. ') endif NULLIFY(grid%q2_btxs) ENDIF IF ( ASSOCIATED( grid%q2_btxe ) ) THEN DEALLOCATE(grid%q2_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4081,& 'frame/module_domain.f: Failed to deallocate grid%q2_btxe. ') endif NULLIFY(grid%q2_btxe) ENDIF IF ( ASSOCIATED( grid%q2_btys ) ) THEN DEALLOCATE(grid%q2_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4089,& 'frame/module_domain.f: Failed to deallocate grid%q2_btys. ') endif NULLIFY(grid%q2_btys) ENDIF IF ( ASSOCIATED( grid%q2_btye ) ) THEN DEALLOCATE(grid%q2_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4097,& 'frame/module_domain.f: Failed to deallocate grid%q2_btye. ') endif NULLIFY(grid%q2_btye) ENDIF IF ( ASSOCIATED( grid%t_adj ) ) THEN DEALLOCATE(grid%t_adj,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4105,& 'frame/module_domain.f: Failed to deallocate grid%t_adj. ') endif ENDIF IF ( ASSOCIATED( grid%t_old ) ) THEN DEALLOCATE(grid%t_old,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4112,& 'frame/module_domain.f: Failed to deallocate grid%t_old. ') endif ENDIF IF ( ASSOCIATED( grid%zero_3d ) ) THEN DEALLOCATE(grid%zero_3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4119,& 'frame/module_domain.f: Failed to deallocate grid%zero_3d. ') endif ENDIF IF ( ASSOCIATED( grid%w0avg ) ) THEN DEALLOCATE(grid%w0avg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4126,& 'frame/module_domain.f: Failed to deallocate grid%w0avg. ') endif ENDIF IF ( ASSOCIATED( grid%akhs_out ) ) THEN DEALLOCATE(grid%akhs_out,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4133,& 'frame/module_domain.f: Failed to deallocate grid%akhs_out. ') endif ENDIF IF ( ASSOCIATED( grid%akms_out ) ) THEN DEALLOCATE(grid%akms_out,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4140,& 'frame/module_domain.f: Failed to deallocate grid%akms_out. ') endif ENDIF IF ( ASSOCIATED( grid%cd_out ) ) THEN DEALLOCATE(grid%cd_out,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4147,& 'frame/module_domain.f: Failed to deallocate grid%cd_out. ') endif ENDIF IF ( ASSOCIATED( grid%ch_out ) ) THEN DEALLOCATE(grid%ch_out,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4154,& 'frame/module_domain.f: Failed to deallocate grid%ch_out. ') endif ENDIF IF ( ASSOCIATED( grid%albase ) ) THEN DEALLOCATE(grid%albase,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4161,& 'frame/module_domain.f: Failed to deallocate grid%albase. ') endif ENDIF IF ( ASSOCIATED( grid%albedo ) ) THEN DEALLOCATE(grid%albedo,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4168,& 'frame/module_domain.f: Failed to deallocate grid%albedo. ') endif ENDIF IF ( ASSOCIATED( grid%cnvbot ) ) THEN DEALLOCATE(grid%cnvbot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4175,& 'frame/module_domain.f: Failed to deallocate grid%cnvbot. ') endif ENDIF IF ( ASSOCIATED( grid%cnvtop ) ) THEN DEALLOCATE(grid%cnvtop,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4182,& 'frame/module_domain.f: Failed to deallocate grid%cnvtop. ') endif ENDIF IF ( ASSOCIATED( grid%czen ) ) THEN DEALLOCATE(grid%czen,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4189,& 'frame/module_domain.f: Failed to deallocate grid%czen. ') endif ENDIF IF ( ASSOCIATED( grid%czmean ) ) THEN DEALLOCATE(grid%czmean,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4196,& 'frame/module_domain.f: Failed to deallocate grid%czmean. ') endif ENDIF IF ( ASSOCIATED( grid%embck ) ) THEN DEALLOCATE(grid%embck,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4203,& 'frame/module_domain.f: Failed to deallocate grid%embck. ') endif ENDIF IF ( ASSOCIATED( grid%epsr ) ) THEN DEALLOCATE(grid%epsr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4210,& 'frame/module_domain.f: Failed to deallocate grid%epsr. ') endif ENDIF IF ( ASSOCIATED( grid%gffc ) ) THEN DEALLOCATE(grid%gffc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4217,& 'frame/module_domain.f: Failed to deallocate grid%gffc. ') endif ENDIF IF ( ASSOCIATED( grid%glat ) ) THEN DEALLOCATE(grid%glat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4224,& 'frame/module_domain.f: Failed to deallocate grid%glat. ') endif ENDIF IF ( ASSOCIATED( grid%glon ) ) THEN DEALLOCATE(grid%glon,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4231,& 'frame/module_domain.f: Failed to deallocate grid%glon. ') endif ENDIF IF ( ASSOCIATED( grid%nmm_tsk ) ) THEN DEALLOCATE(grid%nmm_tsk,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4238,& 'frame/module_domain.f: Failed to deallocate grid%nmm_tsk. ') endif ENDIF IF ( ASSOCIATED( grid%hdac ) ) THEN DEALLOCATE(grid%hdac,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4245,& 'frame/module_domain.f: Failed to deallocate grid%hdac. ') endif ENDIF IF ( ASSOCIATED( grid%hdacv ) ) THEN DEALLOCATE(grid%hdacv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4252,& 'frame/module_domain.f: Failed to deallocate grid%hdacv. ') endif ENDIF IF ( ASSOCIATED( grid%mxsnal ) ) THEN DEALLOCATE(grid%mxsnal,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4259,& 'frame/module_domain.f: Failed to deallocate grid%mxsnal. ') endif ENDIF IF ( ASSOCIATED( grid%radin ) ) THEN DEALLOCATE(grid%radin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4266,& 'frame/module_domain.f: Failed to deallocate grid%radin. ') endif ENDIF IF ( ASSOCIATED( grid%radot ) ) THEN DEALLOCATE(grid%radot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4273,& 'frame/module_domain.f: Failed to deallocate grid%radot. ') endif ENDIF IF ( ASSOCIATED( grid%sigt4 ) ) THEN DEALLOCATE(grid%sigt4,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4280,& 'frame/module_domain.f: Failed to deallocate grid%sigt4. ') endif ENDIF IF ( ASSOCIATED( grid%tg ) ) THEN DEALLOCATE(grid%tg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4287,& 'frame/module_domain.f: Failed to deallocate grid%tg. ') endif ENDIF IF ( ASSOCIATED( grid%dfrlg ) ) THEN DEALLOCATE(grid%dfrlg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4294,& 'frame/module_domain.f: Failed to deallocate grid%dfrlg. ') endif ENDIF IF ( ASSOCIATED( grid%lvl ) ) THEN DEALLOCATE(grid%lvl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4301,& 'frame/module_domain.f: Failed to deallocate grid%lvl. ') endif ENDIF IF ( ASSOCIATED( grid%k22_deep ) ) THEN DEALLOCATE(grid%k22_deep,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4308,& 'frame/module_domain.f: Failed to deallocate grid%k22_deep. ') endif ENDIF IF ( ASSOCIATED( grid%kbcon_deep ) ) THEN DEALLOCATE(grid%kbcon_deep,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4315,& 'frame/module_domain.f: Failed to deallocate grid%kbcon_deep. ') endif ENDIF IF ( ASSOCIATED( grid%ktop_deep ) ) THEN DEALLOCATE(grid%ktop_deep,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4322,& 'frame/module_domain.f: Failed to deallocate grid%ktop_deep. ') endif ENDIF IF ( ASSOCIATED( grid%raincv_a ) ) THEN DEALLOCATE(grid%raincv_a,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4329,& 'frame/module_domain.f: Failed to deallocate grid%raincv_a. ') endif ENDIF IF ( ASSOCIATED( grid%raincv_b ) ) THEN DEALLOCATE(grid%raincv_b,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4336,& 'frame/module_domain.f: Failed to deallocate grid%raincv_b. ') endif ENDIF IF ( ASSOCIATED( grid%gd_cloud ) ) THEN DEALLOCATE(grid%gd_cloud,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4343,& 'frame/module_domain.f: Failed to deallocate grid%gd_cloud. ') endif ENDIF IF ( ASSOCIATED( grid%gd_cloud2 ) ) THEN DEALLOCATE(grid%gd_cloud2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4350,& 'frame/module_domain.f: Failed to deallocate grid%gd_cloud2. ') endif ENDIF IF ( ASSOCIATED( grid%gd_cloud_a ) ) THEN DEALLOCATE(grid%gd_cloud_a,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4357,& 'frame/module_domain.f: Failed to deallocate grid%gd_cloud_a. ') endif ENDIF IF ( ASSOCIATED( grid%gd_cloud2_a ) ) THEN DEALLOCATE(grid%gd_cloud2_a,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4364,& 'frame/module_domain.f: Failed to deallocate grid%gd_cloud2_a. ') endif ENDIF IF ( ASSOCIATED( grid%qc_cu ) ) THEN DEALLOCATE(grid%qc_cu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4371,& 'frame/module_domain.f: Failed to deallocate grid%qc_cu. ') endif ENDIF IF ( ASSOCIATED( grid%qi_cu ) ) THEN DEALLOCATE(grid%qi_cu,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4378,& 'frame/module_domain.f: Failed to deallocate grid%qi_cu. ') endif ENDIF IF ( ASSOCIATED( grid%gd_cldfr ) ) THEN DEALLOCATE(grid%gd_cldfr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4385,& 'frame/module_domain.f: Failed to deallocate grid%gd_cldfr. ') endif ENDIF IF ( ASSOCIATED( grid%xmb_shallow ) ) THEN DEALLOCATE(grid%xmb_shallow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4392,& 'frame/module_domain.f: Failed to deallocate grid%xmb_shallow. ') endif ENDIF IF ( ASSOCIATED( grid%k22_shallow ) ) THEN DEALLOCATE(grid%k22_shallow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4399,& 'frame/module_domain.f: Failed to deallocate grid%k22_shallow. ') endif ENDIF IF ( ASSOCIATED( grid%kbcon_shallow ) ) THEN DEALLOCATE(grid%kbcon_shallow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4406,& 'frame/module_domain.f: Failed to deallocate grid%kbcon_shallow. ') endif ENDIF IF ( ASSOCIATED( grid%ktop_shallow ) ) THEN DEALLOCATE(grid%ktop_shallow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4413,& 'frame/module_domain.f: Failed to deallocate grid%ktop_shallow. ') endif ENDIF IF ( ASSOCIATED( grid%ierr_shallow ) ) THEN DEALLOCATE(grid%ierr_shallow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4420,& 'frame/module_domain.f: Failed to deallocate grid%ierr_shallow. ') endif ENDIF IF ( ASSOCIATED( grid%acswupt ) ) THEN DEALLOCATE(grid%acswupt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4427,& 'frame/module_domain.f: Failed to deallocate grid%acswupt. ') endif ENDIF IF ( ASSOCIATED( grid%acswuptc ) ) THEN DEALLOCATE(grid%acswuptc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4434,& 'frame/module_domain.f: Failed to deallocate grid%acswuptc. ') endif ENDIF IF ( ASSOCIATED( grid%acswdnt ) ) THEN DEALLOCATE(grid%acswdnt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4441,& 'frame/module_domain.f: Failed to deallocate grid%acswdnt. ') endif ENDIF IF ( ASSOCIATED( grid%acswdntc ) ) THEN DEALLOCATE(grid%acswdntc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4448,& 'frame/module_domain.f: Failed to deallocate grid%acswdntc. ') endif ENDIF IF ( ASSOCIATED( grid%acswupb ) ) THEN DEALLOCATE(grid%acswupb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4455,& 'frame/module_domain.f: Failed to deallocate grid%acswupb. ') endif ENDIF IF ( ASSOCIATED( grid%acswupbc ) ) THEN DEALLOCATE(grid%acswupbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4462,& 'frame/module_domain.f: Failed to deallocate grid%acswupbc. ') endif ENDIF IF ( ASSOCIATED( grid%acswdnb ) ) THEN DEALLOCATE(grid%acswdnb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4469,& 'frame/module_domain.f: Failed to deallocate grid%acswdnb. ') endif ENDIF IF ( ASSOCIATED( grid%acswdnbc ) ) THEN DEALLOCATE(grid%acswdnbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4476,& 'frame/module_domain.f: Failed to deallocate grid%acswdnbc. ') endif ENDIF IF ( ASSOCIATED( grid%aclwupt ) ) THEN DEALLOCATE(grid%aclwupt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4483,& 'frame/module_domain.f: Failed to deallocate grid%aclwupt. ') endif ENDIF IF ( ASSOCIATED( grid%aclwuptc ) ) THEN DEALLOCATE(grid%aclwuptc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4490,& 'frame/module_domain.f: Failed to deallocate grid%aclwuptc. ') endif ENDIF IF ( ASSOCIATED( grid%aclwdnt ) ) THEN DEALLOCATE(grid%aclwdnt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4497,& 'frame/module_domain.f: Failed to deallocate grid%aclwdnt. ') endif ENDIF IF ( ASSOCIATED( grid%aclwdntc ) ) THEN DEALLOCATE(grid%aclwdntc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4504,& 'frame/module_domain.f: Failed to deallocate grid%aclwdntc. ') endif ENDIF IF ( ASSOCIATED( grid%aclwupb ) ) THEN DEALLOCATE(grid%aclwupb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4511,& 'frame/module_domain.f: Failed to deallocate grid%aclwupb. ') endif ENDIF IF ( ASSOCIATED( grid%aclwupbc ) ) THEN DEALLOCATE(grid%aclwupbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4518,& 'frame/module_domain.f: Failed to deallocate grid%aclwupbc. ') endif ENDIF IF ( ASSOCIATED( grid%aclwdnb ) ) THEN DEALLOCATE(grid%aclwdnb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4525,& 'frame/module_domain.f: Failed to deallocate grid%aclwdnb. ') endif ENDIF IF ( ASSOCIATED( grid%aclwdnbc ) ) THEN DEALLOCATE(grid%aclwdnbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4532,& 'frame/module_domain.f: Failed to deallocate grid%aclwdnbc. ') endif ENDIF IF ( ASSOCIATED( grid%swupt ) ) THEN DEALLOCATE(grid%swupt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4539,& 'frame/module_domain.f: Failed to deallocate grid%swupt. ') endif ENDIF IF ( ASSOCIATED( grid%swuptc ) ) THEN DEALLOCATE(grid%swuptc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4546,& 'frame/module_domain.f: Failed to deallocate grid%swuptc. ') endif ENDIF IF ( ASSOCIATED( grid%swdnt ) ) THEN DEALLOCATE(grid%swdnt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4553,& 'frame/module_domain.f: Failed to deallocate grid%swdnt. ') endif ENDIF IF ( ASSOCIATED( grid%swdntc ) ) THEN DEALLOCATE(grid%swdntc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4560,& 'frame/module_domain.f: Failed to deallocate grid%swdntc. ') endif ENDIF IF ( ASSOCIATED( grid%swupb ) ) THEN DEALLOCATE(grid%swupb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4567,& 'frame/module_domain.f: Failed to deallocate grid%swupb. ') endif ENDIF IF ( ASSOCIATED( grid%swupbc ) ) THEN DEALLOCATE(grid%swupbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4574,& 'frame/module_domain.f: Failed to deallocate grid%swupbc. ') endif ENDIF IF ( ASSOCIATED( grid%swdnb ) ) THEN DEALLOCATE(grid%swdnb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4581,& 'frame/module_domain.f: Failed to deallocate grid%swdnb. ') endif ENDIF IF ( ASSOCIATED( grid%swdnbc ) ) THEN DEALLOCATE(grid%swdnbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4588,& 'frame/module_domain.f: Failed to deallocate grid%swdnbc. ') endif ENDIF IF ( ASSOCIATED( grid%lwupt ) ) THEN DEALLOCATE(grid%lwupt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4595,& 'frame/module_domain.f: Failed to deallocate grid%lwupt. ') endif ENDIF IF ( ASSOCIATED( grid%lwuptc ) ) THEN DEALLOCATE(grid%lwuptc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4602,& 'frame/module_domain.f: Failed to deallocate grid%lwuptc. ') endif ENDIF IF ( ASSOCIATED( grid%lwdnt ) ) THEN DEALLOCATE(grid%lwdnt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4609,& 'frame/module_domain.f: Failed to deallocate grid%lwdnt. ') endif ENDIF IF ( ASSOCIATED( grid%lwdntc ) ) THEN DEALLOCATE(grid%lwdntc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4616,& 'frame/module_domain.f: Failed to deallocate grid%lwdntc. ') endif ENDIF IF ( ASSOCIATED( grid%lwupb ) ) THEN DEALLOCATE(grid%lwupb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4623,& 'frame/module_domain.f: Failed to deallocate grid%lwupb. ') endif ENDIF IF ( ASSOCIATED( grid%lwupbc ) ) THEN DEALLOCATE(grid%lwupbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4630,& 'frame/module_domain.f: Failed to deallocate grid%lwupbc. ') endif ENDIF IF ( ASSOCIATED( grid%lwdnb ) ) THEN DEALLOCATE(grid%lwdnb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4637,& 'frame/module_domain.f: Failed to deallocate grid%lwdnb. ') endif ENDIF IF ( ASSOCIATED( grid%lwdnbc ) ) THEN DEALLOCATE(grid%lwdnbc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4644,& 'frame/module_domain.f: Failed to deallocate grid%lwdnbc. ') endif ENDIF IF ( ASSOCIATED( grid%swvisdir ) ) THEN DEALLOCATE(grid%swvisdir,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4651,& 'frame/module_domain.f: Failed to deallocate grid%swvisdir. ') endif ENDIF IF ( ASSOCIATED( grid%swvisdif ) ) THEN DEALLOCATE(grid%swvisdif,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4658,& 'frame/module_domain.f: Failed to deallocate grid%swvisdif. ') endif ENDIF IF ( ASSOCIATED( grid%swnirdir ) ) THEN DEALLOCATE(grid%swnirdir,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4665,& 'frame/module_domain.f: Failed to deallocate grid%swnirdir. ') endif ENDIF IF ( ASSOCIATED( grid%swnirdif ) ) THEN DEALLOCATE(grid%swnirdif,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4672,& 'frame/module_domain.f: Failed to deallocate grid%swnirdif. ') endif ENDIF IF ( ASSOCIATED( grid%refl_10cm ) ) THEN DEALLOCATE(grid%refl_10cm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4679,& 'frame/module_domain.f: Failed to deallocate grid%refl_10cm. ') endif ENDIF IF ( ASSOCIATED( grid%refd_max ) ) THEN DEALLOCATE(grid%refd_max,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4686,& 'frame/module_domain.f: Failed to deallocate grid%refd_max. ') endif ENDIF IF ( ASSOCIATED( grid%qnwfa2d ) ) THEN DEALLOCATE(grid%qnwfa2d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4693,& 'frame/module_domain.f: Failed to deallocate grid%qnwfa2d. ') endif ENDIF IF ( ASSOCIATED( grid%re_cloud ) ) THEN DEALLOCATE(grid%re_cloud,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4700,& 'frame/module_domain.f: Failed to deallocate grid%re_cloud. ') endif ENDIF IF ( ASSOCIATED( grid%re_ice ) ) THEN DEALLOCATE(grid%re_ice,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4707,& 'frame/module_domain.f: Failed to deallocate grid%re_ice. ') endif ENDIF IF ( ASSOCIATED( grid%re_snow ) ) THEN DEALLOCATE(grid%re_snow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4714,& 'frame/module_domain.f: Failed to deallocate grid%re_snow. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_re_cloud ) ) THEN DEALLOCATE(grid%dfi_re_cloud,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4721,& 'frame/module_domain.f: Failed to deallocate grid%dfi_re_cloud. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_re_ice ) ) THEN DEALLOCATE(grid%dfi_re_ice,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4728,& 'frame/module_domain.f: Failed to deallocate grid%dfi_re_ice. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_re_snow ) ) THEN DEALLOCATE(grid%dfi_re_snow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4735,& 'frame/module_domain.f: Failed to deallocate grid%dfi_re_snow. ') endif ENDIF IF ( ASSOCIATED( grid%hrswpd ) ) THEN DEALLOCATE(grid%hrswpd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4742,& 'frame/module_domain.f: Failed to deallocate grid%hrswpd. ') endif ENDIF IF ( ASSOCIATED( grid%hrlwpd ) ) THEN DEALLOCATE(grid%hrlwpd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4749,& 'frame/module_domain.f: Failed to deallocate grid%hrlwpd. ') endif ENDIF IF ( ASSOCIATED( grid%swddir ) ) THEN DEALLOCATE(grid%swddir,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4756,& 'frame/module_domain.f: Failed to deallocate grid%swddir. ') endif ENDIF IF ( ASSOCIATED( grid%swddni ) ) THEN DEALLOCATE(grid%swddni,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4763,& 'frame/module_domain.f: Failed to deallocate grid%swddni. ') endif ENDIF IF ( ASSOCIATED( grid%swddif ) ) THEN DEALLOCATE(grid%swddif,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4770,& 'frame/module_domain.f: Failed to deallocate grid%swddif. ') endif ENDIF IF ( ASSOCIATED( grid%gx ) ) THEN DEALLOCATE(grid%gx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4777,& 'frame/module_domain.f: Failed to deallocate grid%gx. ') endif ENDIF IF ( ASSOCIATED( grid%bx ) ) THEN DEALLOCATE(grid%bx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4784,& 'frame/module_domain.f: Failed to deallocate grid%bx. ') endif ENDIF IF ( ASSOCIATED( grid%gg ) ) THEN DEALLOCATE(grid%gg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4791,& 'frame/module_domain.f: Failed to deallocate grid%gg. ') endif ENDIF IF ( ASSOCIATED( grid%bb ) ) THEN DEALLOCATE(grid%bb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4798,& 'frame/module_domain.f: Failed to deallocate grid%bb. ') endif ENDIF IF ( ASSOCIATED( grid%coszen_ref ) ) THEN DEALLOCATE(grid%coszen_ref,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4805,& 'frame/module_domain.f: Failed to deallocate grid%coszen_ref. ') endif ENDIF IF ( ASSOCIATED( grid%coszen ) ) THEN DEALLOCATE(grid%coszen,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4812,& 'frame/module_domain.f: Failed to deallocate grid%coszen. ') endif ENDIF IF ( ASSOCIATED( grid%hrang ) ) THEN DEALLOCATE(grid%hrang,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4819,& 'frame/module_domain.f: Failed to deallocate grid%hrang. ') endif ENDIF IF ( ASSOCIATED( grid%swdown_ref ) ) THEN DEALLOCATE(grid%swdown_ref,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4826,& 'frame/module_domain.f: Failed to deallocate grid%swdown_ref. ') endif ENDIF IF ( ASSOCIATED( grid%swddir_ref ) ) THEN DEALLOCATE(grid%swddir_ref,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4833,& 'frame/module_domain.f: Failed to deallocate grid%swddir_ref. ') endif ENDIF IF ( ASSOCIATED( grid%cwm ) ) THEN DEALLOCATE(grid%cwm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4840,& 'frame/module_domain.f: Failed to deallocate grid%cwm. ') endif ENDIF IF ( ASSOCIATED( grid%cwm_bxs ) ) THEN DEALLOCATE(grid%cwm_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4847,& 'frame/module_domain.f: Failed to deallocate grid%cwm_bxs. ') endif NULLIFY(grid%cwm_bxs) ENDIF IF ( ASSOCIATED( grid%cwm_bxe ) ) THEN DEALLOCATE(grid%cwm_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4855,& 'frame/module_domain.f: Failed to deallocate grid%cwm_bxe. ') endif NULLIFY(grid%cwm_bxe) ENDIF IF ( ASSOCIATED( grid%cwm_bys ) ) THEN DEALLOCATE(grid%cwm_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4863,& 'frame/module_domain.f: Failed to deallocate grid%cwm_bys. ') endif NULLIFY(grid%cwm_bys) ENDIF IF ( ASSOCIATED( grid%cwm_bye ) ) THEN DEALLOCATE(grid%cwm_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4871,& 'frame/module_domain.f: Failed to deallocate grid%cwm_bye. ') endif NULLIFY(grid%cwm_bye) ENDIF IF ( ASSOCIATED( grid%cwm_btxs ) ) THEN DEALLOCATE(grid%cwm_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4879,& 'frame/module_domain.f: Failed to deallocate grid%cwm_btxs. ') endif NULLIFY(grid%cwm_btxs) ENDIF IF ( ASSOCIATED( grid%cwm_btxe ) ) THEN DEALLOCATE(grid%cwm_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4887,& 'frame/module_domain.f: Failed to deallocate grid%cwm_btxe. ') endif NULLIFY(grid%cwm_btxe) ENDIF IF ( ASSOCIATED( grid%cwm_btys ) ) THEN DEALLOCATE(grid%cwm_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4895,& 'frame/module_domain.f: Failed to deallocate grid%cwm_btys. ') endif NULLIFY(grid%cwm_btys) ENDIF IF ( ASSOCIATED( grid%cwm_btye ) ) THEN DEALLOCATE(grid%cwm_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4903,& 'frame/module_domain.f: Failed to deallocate grid%cwm_btye. ') endif NULLIFY(grid%cwm_btye) ENDIF IF ( ASSOCIATED( grid%rrw ) ) THEN DEALLOCATE(grid%rrw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4911,& 'frame/module_domain.f: Failed to deallocate grid%rrw. ') endif ENDIF IF ( ASSOCIATED( grid%rrw_bxs ) ) THEN DEALLOCATE(grid%rrw_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4918,& 'frame/module_domain.f: Failed to deallocate grid%rrw_bxs. ') endif NULLIFY(grid%rrw_bxs) ENDIF IF ( ASSOCIATED( grid%rrw_bxe ) ) THEN DEALLOCATE(grid%rrw_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4926,& 'frame/module_domain.f: Failed to deallocate grid%rrw_bxe. ') endif NULLIFY(grid%rrw_bxe) ENDIF IF ( ASSOCIATED( grid%rrw_bys ) ) THEN DEALLOCATE(grid%rrw_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4934,& 'frame/module_domain.f: Failed to deallocate grid%rrw_bys. ') endif NULLIFY(grid%rrw_bys) ENDIF IF ( ASSOCIATED( grid%rrw_bye ) ) THEN DEALLOCATE(grid%rrw_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4942,& 'frame/module_domain.f: Failed to deallocate grid%rrw_bye. ') endif NULLIFY(grid%rrw_bye) ENDIF IF ( ASSOCIATED( grid%rrw_btxs ) ) THEN DEALLOCATE(grid%rrw_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4950,& 'frame/module_domain.f: Failed to deallocate grid%rrw_btxs. ') endif NULLIFY(grid%rrw_btxs) ENDIF IF ( ASSOCIATED( grid%rrw_btxe ) ) THEN DEALLOCATE(grid%rrw_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4958,& 'frame/module_domain.f: Failed to deallocate grid%rrw_btxe. ') endif NULLIFY(grid%rrw_btxe) ENDIF IF ( ASSOCIATED( grid%rrw_btys ) ) THEN DEALLOCATE(grid%rrw_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4966,& 'frame/module_domain.f: Failed to deallocate grid%rrw_btys. ') endif NULLIFY(grid%rrw_btys) ENDIF IF ( ASSOCIATED( grid%rrw_btye ) ) THEN DEALLOCATE(grid%rrw_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4974,& 'frame/module_domain.f: Failed to deallocate grid%rrw_btye. ') endif NULLIFY(grid%rrw_btye) ENDIF IF ( ASSOCIATED( grid%f_ice ) ) THEN DEALLOCATE(grid%f_ice,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4982,& 'frame/module_domain.f: Failed to deallocate grid%f_ice. ') endif ENDIF IF ( ASSOCIATED( grid%f_rain ) ) THEN DEALLOCATE(grid%f_rain,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4989,& 'frame/module_domain.f: Failed to deallocate grid%f_rain. ') endif ENDIF IF ( ASSOCIATED( grid%f_rimef ) ) THEN DEALLOCATE(grid%f_rimef,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",4996,& 'frame/module_domain.f: Failed to deallocate grid%f_rimef. ') endif ENDIF IF ( ASSOCIATED( grid%cldfra ) ) THEN DEALLOCATE(grid%cldfra,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5003,& 'frame/module_domain.f: Failed to deallocate grid%cldfra. ') endif ENDIF IF ( ASSOCIATED( grid%sr ) ) THEN DEALLOCATE(grid%sr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5010,& 'frame/module_domain.f: Failed to deallocate grid%sr. ') endif ENDIF IF ( ASSOCIATED( grid%cfrach ) ) THEN DEALLOCATE(grid%cfrach,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5017,& 'frame/module_domain.f: Failed to deallocate grid%cfrach. ') endif ENDIF IF ( ASSOCIATED( grid%cfracl ) ) THEN DEALLOCATE(grid%cfracl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5024,& 'frame/module_domain.f: Failed to deallocate grid%cfracl. ') endif ENDIF IF ( ASSOCIATED( grid%cfracm ) ) THEN DEALLOCATE(grid%cfracm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5031,& 'frame/module_domain.f: Failed to deallocate grid%cfracm. ') endif ENDIF IF ( ASSOCIATED( grid%islope ) ) THEN DEALLOCATE(grid%islope,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5038,& 'frame/module_domain.f: Failed to deallocate grid%islope. ') endif ENDIF IF ( ASSOCIATED( grid%dzsoil ) ) THEN DEALLOCATE(grid%dzsoil,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5045,& 'frame/module_domain.f: Failed to deallocate grid%dzsoil. ') endif ENDIF IF ( ASSOCIATED( grid%rtdpth ) ) THEN DEALLOCATE(grid%rtdpth,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5052,& 'frame/module_domain.f: Failed to deallocate grid%rtdpth. ') endif ENDIF IF ( ASSOCIATED( grid%sldpth ) ) THEN DEALLOCATE(grid%sldpth,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5059,& 'frame/module_domain.f: Failed to deallocate grid%sldpth. ') endif ENDIF IF ( ASSOCIATED( grid%cmc ) ) THEN DEALLOCATE(grid%cmc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5066,& 'frame/module_domain.f: Failed to deallocate grid%cmc. ') endif ENDIF IF ( ASSOCIATED( grid%grnflx ) ) THEN DEALLOCATE(grid%grnflx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5073,& 'frame/module_domain.f: Failed to deallocate grid%grnflx. ') endif ENDIF IF ( ASSOCIATED( grid%pctsno ) ) THEN DEALLOCATE(grid%pctsno,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5080,& 'frame/module_domain.f: Failed to deallocate grid%pctsno. ') endif ENDIF IF ( ASSOCIATED( grid%soiltb ) ) THEN DEALLOCATE(grid%soiltb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5087,& 'frame/module_domain.f: Failed to deallocate grid%soiltb. ') endif ENDIF IF ( ASSOCIATED( grid%vegfrc ) ) THEN DEALLOCATE(grid%vegfrc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5094,& 'frame/module_domain.f: Failed to deallocate grid%vegfrc. ') endif ENDIF IF ( ASSOCIATED( grid%shdmax ) ) THEN DEALLOCATE(grid%shdmax,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5101,& 'frame/module_domain.f: Failed to deallocate grid%shdmax. ') endif ENDIF IF ( ASSOCIATED( grid%shdmin ) ) THEN DEALLOCATE(grid%shdmin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5108,& 'frame/module_domain.f: Failed to deallocate grid%shdmin. ') endif ENDIF IF ( ASSOCIATED( grid%sh2o ) ) THEN DEALLOCATE(grid%sh2o,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5115,& 'frame/module_domain.f: Failed to deallocate grid%sh2o. ') endif ENDIF IF ( ASSOCIATED( grid%smc ) ) THEN DEALLOCATE(grid%smc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5122,& 'frame/module_domain.f: Failed to deallocate grid%smc. ') endif ENDIF IF ( ASSOCIATED( grid%stc ) ) THEN DEALLOCATE(grid%stc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5129,& 'frame/module_domain.f: Failed to deallocate grid%stc. ') endif ENDIF IF ( ASSOCIATED( grid%hstdv ) ) THEN DEALLOCATE(grid%hstdv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5136,& 'frame/module_domain.f: Failed to deallocate grid%hstdv. ') endif ENDIF IF ( ASSOCIATED( grid%hcnvx ) ) THEN DEALLOCATE(grid%hcnvx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5143,& 'frame/module_domain.f: Failed to deallocate grid%hcnvx. ') endif ENDIF IF ( ASSOCIATED( grid%hasyw ) ) THEN DEALLOCATE(grid%hasyw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5150,& 'frame/module_domain.f: Failed to deallocate grid%hasyw. ') endif ENDIF IF ( ASSOCIATED( grid%hasys ) ) THEN DEALLOCATE(grid%hasys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5157,& 'frame/module_domain.f: Failed to deallocate grid%hasys. ') endif ENDIF IF ( ASSOCIATED( grid%hasysw ) ) THEN DEALLOCATE(grid%hasysw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5164,& 'frame/module_domain.f: Failed to deallocate grid%hasysw. ') endif ENDIF IF ( ASSOCIATED( grid%hasynw ) ) THEN DEALLOCATE(grid%hasynw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5171,& 'frame/module_domain.f: Failed to deallocate grid%hasynw. ') endif ENDIF IF ( ASSOCIATED( grid%hlenw ) ) THEN DEALLOCATE(grid%hlenw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5178,& 'frame/module_domain.f: Failed to deallocate grid%hlenw. ') endif ENDIF IF ( ASSOCIATED( grid%hlens ) ) THEN DEALLOCATE(grid%hlens,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5185,& 'frame/module_domain.f: Failed to deallocate grid%hlens. ') endif ENDIF IF ( ASSOCIATED( grid%hlensw ) ) THEN DEALLOCATE(grid%hlensw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5192,& 'frame/module_domain.f: Failed to deallocate grid%hlensw. ') endif ENDIF IF ( ASSOCIATED( grid%hlennw ) ) THEN DEALLOCATE(grid%hlennw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5199,& 'frame/module_domain.f: Failed to deallocate grid%hlennw. ') endif ENDIF IF ( ASSOCIATED( grid%hangl ) ) THEN DEALLOCATE(grid%hangl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5206,& 'frame/module_domain.f: Failed to deallocate grid%hangl. ') endif ENDIF IF ( ASSOCIATED( grid%hanis ) ) THEN DEALLOCATE(grid%hanis,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5213,& 'frame/module_domain.f: Failed to deallocate grid%hanis. ') endif ENDIF IF ( ASSOCIATED( grid%hslop ) ) THEN DEALLOCATE(grid%hslop,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5220,& 'frame/module_domain.f: Failed to deallocate grid%hslop. ') endif ENDIF IF ( ASSOCIATED( grid%hzmax ) ) THEN DEALLOCATE(grid%hzmax,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5227,& 'frame/module_domain.f: Failed to deallocate grid%hzmax. ') endif ENDIF IF ( ASSOCIATED( grid%crot ) ) THEN DEALLOCATE(grid%crot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5234,& 'frame/module_domain.f: Failed to deallocate grid%crot. ') endif ENDIF IF ( ASSOCIATED( grid%srot ) ) THEN DEALLOCATE(grid%srot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5241,& 'frame/module_domain.f: Failed to deallocate grid%srot. ') endif ENDIF IF ( ASSOCIATED( grid%ugwdsfc ) ) THEN DEALLOCATE(grid%ugwdsfc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5248,& 'frame/module_domain.f: Failed to deallocate grid%ugwdsfc. ') endif ENDIF IF ( ASSOCIATED( grid%vgwdsfc ) ) THEN DEALLOCATE(grid%vgwdsfc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5255,& 'frame/module_domain.f: Failed to deallocate grid%vgwdsfc. ') endif ENDIF IF ( ASSOCIATED( grid%ctopo ) ) THEN DEALLOCATE(grid%ctopo,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5262,& 'frame/module_domain.f: Failed to deallocate grid%ctopo. ') endif ENDIF IF ( ASSOCIATED( grid%ctopo2 ) ) THEN DEALLOCATE(grid%ctopo2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5269,& 'frame/module_domain.f: Failed to deallocate grid%ctopo2. ') endif ENDIF IF ( ASSOCIATED( grid%dwdtmn ) ) THEN DEALLOCATE(grid%dwdtmn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5276,& 'frame/module_domain.f: Failed to deallocate grid%dwdtmn. ') endif ENDIF IF ( ASSOCIATED( grid%dwdtmx ) ) THEN DEALLOCATE(grid%dwdtmx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5283,& 'frame/module_domain.f: Failed to deallocate grid%dwdtmx. ') endif ENDIF IF ( ASSOCIATED( grid%baro ) ) THEN DEALLOCATE(grid%baro,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5290,& 'frame/module_domain.f: Failed to deallocate grid%baro. ') endif ENDIF IF ( ASSOCIATED( grid%dwdt ) ) THEN DEALLOCATE(grid%dwdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5297,& 'frame/module_domain.f: Failed to deallocate grid%dwdt. ') endif ENDIF IF ( ASSOCIATED( grid%pdwdt ) ) THEN DEALLOCATE(grid%pdwdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5304,& 'frame/module_domain.f: Failed to deallocate grid%pdwdt. ') endif ENDIF IF ( ASSOCIATED( grid%pint ) ) THEN DEALLOCATE(grid%pint,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5311,& 'frame/module_domain.f: Failed to deallocate grid%pint. ') endif ENDIF IF ( ASSOCIATED( grid%w ) ) THEN DEALLOCATE(grid%w,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5318,& 'frame/module_domain.f: Failed to deallocate grid%w. ') endif ENDIF IF ( ASSOCIATED( grid%w_tot ) ) THEN DEALLOCATE(grid%w_tot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5325,& 'frame/module_domain.f: Failed to deallocate grid%w_tot. ') endif ENDIF IF ( ASSOCIATED( grid%z ) ) THEN DEALLOCATE(grid%z,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5332,& 'frame/module_domain.f: Failed to deallocate grid%z. ') endif ENDIF IF ( ASSOCIATED( grid%acfrcv ) ) THEN DEALLOCATE(grid%acfrcv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5339,& 'frame/module_domain.f: Failed to deallocate grid%acfrcv. ') endif ENDIF IF ( ASSOCIATED( grid%acfrst ) ) THEN DEALLOCATE(grid%acfrst,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5346,& 'frame/module_domain.f: Failed to deallocate grid%acfrst. ') endif ENDIF IF ( ASSOCIATED( grid%ssroff ) ) THEN DEALLOCATE(grid%ssroff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5353,& 'frame/module_domain.f: Failed to deallocate grid%ssroff. ') endif ENDIF IF ( ASSOCIATED( grid%bgroff ) ) THEN DEALLOCATE(grid%bgroff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5360,& 'frame/module_domain.f: Failed to deallocate grid%bgroff. ') endif ENDIF IF ( ASSOCIATED( grid%rlwin ) ) THEN DEALLOCATE(grid%rlwin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5367,& 'frame/module_domain.f: Failed to deallocate grid%rlwin. ') endif ENDIF IF ( ASSOCIATED( grid%rlwout ) ) THEN DEALLOCATE(grid%rlwout,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5374,& 'frame/module_domain.f: Failed to deallocate grid%rlwout. ') endif ENDIF IF ( ASSOCIATED( grid%rlwtoa ) ) THEN DEALLOCATE(grid%rlwtoa,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5381,& 'frame/module_domain.f: Failed to deallocate grid%rlwtoa. ') endif ENDIF IF ( ASSOCIATED( grid%alwin ) ) THEN DEALLOCATE(grid%alwin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5388,& 'frame/module_domain.f: Failed to deallocate grid%alwin. ') endif ENDIF IF ( ASSOCIATED( grid%alwout ) ) THEN DEALLOCATE(grid%alwout,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5395,& 'frame/module_domain.f: Failed to deallocate grid%alwout. ') endif ENDIF IF ( ASSOCIATED( grid%alwtoa ) ) THEN DEALLOCATE(grid%alwtoa,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5402,& 'frame/module_domain.f: Failed to deallocate grid%alwtoa. ') endif ENDIF IF ( ASSOCIATED( grid%rswin ) ) THEN DEALLOCATE(grid%rswin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5409,& 'frame/module_domain.f: Failed to deallocate grid%rswin. ') endif ENDIF IF ( ASSOCIATED( grid%rswinc ) ) THEN DEALLOCATE(grid%rswinc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5416,& 'frame/module_domain.f: Failed to deallocate grid%rswinc. ') endif ENDIF IF ( ASSOCIATED( grid%rswout ) ) THEN DEALLOCATE(grid%rswout,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5423,& 'frame/module_domain.f: Failed to deallocate grid%rswout. ') endif ENDIF IF ( ASSOCIATED( grid%rswtoa ) ) THEN DEALLOCATE(grid%rswtoa,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5430,& 'frame/module_domain.f: Failed to deallocate grid%rswtoa. ') endif ENDIF IF ( ASSOCIATED( grid%aswin ) ) THEN DEALLOCATE(grid%aswin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5437,& 'frame/module_domain.f: Failed to deallocate grid%aswin. ') endif ENDIF IF ( ASSOCIATED( grid%aswout ) ) THEN DEALLOCATE(grid%aswout,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5444,& 'frame/module_domain.f: Failed to deallocate grid%aswout. ') endif ENDIF IF ( ASSOCIATED( grid%aswtoa ) ) THEN DEALLOCATE(grid%aswtoa,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5451,& 'frame/module_domain.f: Failed to deallocate grid%aswtoa. ') endif ENDIF IF ( ASSOCIATED( grid%sfcshx ) ) THEN DEALLOCATE(grid%sfcshx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5458,& 'frame/module_domain.f: Failed to deallocate grid%sfcshx. ') endif ENDIF IF ( ASSOCIATED( grid%sfclhx ) ) THEN DEALLOCATE(grid%sfclhx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5465,& 'frame/module_domain.f: Failed to deallocate grid%sfclhx. ') endif ENDIF IF ( ASSOCIATED( grid%subshx ) ) THEN DEALLOCATE(grid%subshx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5472,& 'frame/module_domain.f: Failed to deallocate grid%subshx. ') endif ENDIF IF ( ASSOCIATED( grid%snopcx ) ) THEN DEALLOCATE(grid%snopcx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5479,& 'frame/module_domain.f: Failed to deallocate grid%snopcx. ') endif ENDIF IF ( ASSOCIATED( grid%sfcuvx ) ) THEN DEALLOCATE(grid%sfcuvx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5486,& 'frame/module_domain.f: Failed to deallocate grid%sfcuvx. ') endif ENDIF IF ( ASSOCIATED( grid%potevp ) ) THEN DEALLOCATE(grid%potevp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5493,& 'frame/module_domain.f: Failed to deallocate grid%potevp. ') endif ENDIF IF ( ASSOCIATED( grid%potflx ) ) THEN DEALLOCATE(grid%potflx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5500,& 'frame/module_domain.f: Failed to deallocate grid%potflx. ') endif ENDIF IF ( ASSOCIATED( grid%tlmin ) ) THEN DEALLOCATE(grid%tlmin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5507,& 'frame/module_domain.f: Failed to deallocate grid%tlmin. ') endif ENDIF IF ( ASSOCIATED( grid%tlmax ) ) THEN DEALLOCATE(grid%tlmax,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5514,& 'frame/module_domain.f: Failed to deallocate grid%tlmax. ') endif ENDIF IF ( ASSOCIATED( grid%t02_min ) ) THEN DEALLOCATE(grid%t02_min,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5521,& 'frame/module_domain.f: Failed to deallocate grid%t02_min. ') endif ENDIF IF ( ASSOCIATED( grid%t02_max ) ) THEN DEALLOCATE(grid%t02_max,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5528,& 'frame/module_domain.f: Failed to deallocate grid%t02_max. ') endif ENDIF IF ( ASSOCIATED( grid%rh02_min ) ) THEN DEALLOCATE(grid%rh02_min,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5535,& 'frame/module_domain.f: Failed to deallocate grid%rh02_min. ') endif ENDIF IF ( ASSOCIATED( grid%rh02_max ) ) THEN DEALLOCATE(grid%rh02_max,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5542,& 'frame/module_domain.f: Failed to deallocate grid%rh02_max. ') endif ENDIF IF ( ASSOCIATED( grid%rlwtt ) ) THEN DEALLOCATE(grid%rlwtt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5549,& 'frame/module_domain.f: Failed to deallocate grid%rlwtt. ') endif ENDIF IF ( ASSOCIATED( grid%rswtt ) ) THEN DEALLOCATE(grid%rswtt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5556,& 'frame/module_domain.f: Failed to deallocate grid%rswtt. ') endif ENDIF IF ( ASSOCIATED( grid%tcucn ) ) THEN DEALLOCATE(grid%tcucn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5563,& 'frame/module_domain.f: Failed to deallocate grid%tcucn. ') endif ENDIF IF ( ASSOCIATED( grid%train ) ) THEN DEALLOCATE(grid%train,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5570,& 'frame/module_domain.f: Failed to deallocate grid%train. ') endif ENDIF IF ( ASSOCIATED( grid%ncfrcv ) ) THEN DEALLOCATE(grid%ncfrcv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5577,& 'frame/module_domain.f: Failed to deallocate grid%ncfrcv. ') endif ENDIF IF ( ASSOCIATED( grid%ncfrst ) ) THEN DEALLOCATE(grid%ncfrst,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5584,& 'frame/module_domain.f: Failed to deallocate grid%ncfrst. ') endif ENDIF IF ( ASSOCIATED( grid%ihe ) ) THEN DEALLOCATE(grid%ihe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5591,& 'frame/module_domain.f: Failed to deallocate grid%ihe. ') endif ENDIF IF ( ASSOCIATED( grid%ihw ) ) THEN DEALLOCATE(grid%ihw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5598,& 'frame/module_domain.f: Failed to deallocate grid%ihw. ') endif ENDIF IF ( ASSOCIATED( grid%ive ) ) THEN DEALLOCATE(grid%ive,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5605,& 'frame/module_domain.f: Failed to deallocate grid%ive. ') endif ENDIF IF ( ASSOCIATED( grid%ivw ) ) THEN DEALLOCATE(grid%ivw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5612,& 'frame/module_domain.f: Failed to deallocate grid%ivw. ') endif ENDIF IF ( ASSOCIATED( grid%irad ) ) THEN DEALLOCATE(grid%irad,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5619,& 'frame/module_domain.f: Failed to deallocate grid%irad. ') endif ENDIF IF ( ASSOCIATED( grid%iheg ) ) THEN DEALLOCATE(grid%iheg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5626,& 'frame/module_domain.f: Failed to deallocate grid%iheg. ') endif ENDIF IF ( ASSOCIATED( grid%ihwg ) ) THEN DEALLOCATE(grid%ihwg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5633,& 'frame/module_domain.f: Failed to deallocate grid%ihwg. ') endif ENDIF IF ( ASSOCIATED( grid%iveg ) ) THEN DEALLOCATE(grid%iveg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5640,& 'frame/module_domain.f: Failed to deallocate grid%iveg. ') endif ENDIF IF ( ASSOCIATED( grid%ivwg ) ) THEN DEALLOCATE(grid%ivwg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5647,& 'frame/module_domain.f: Failed to deallocate grid%ivwg. ') endif ENDIF IF ( ASSOCIATED( grid%iradg ) ) THEN DEALLOCATE(grid%iradg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5654,& 'frame/module_domain.f: Failed to deallocate grid%iradg. ') endif ENDIF IF ( ASSOCIATED( grid%n_iup_h ) ) THEN DEALLOCATE(grid%n_iup_h,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5661,& 'frame/module_domain.f: Failed to deallocate grid%n_iup_h. ') endif ENDIF IF ( ASSOCIATED( grid%n_iup_v ) ) THEN DEALLOCATE(grid%n_iup_v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5668,& 'frame/module_domain.f: Failed to deallocate grid%n_iup_v. ') endif ENDIF IF ( ASSOCIATED( grid%n_iup_adh ) ) THEN DEALLOCATE(grid%n_iup_adh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5675,& 'frame/module_domain.f: Failed to deallocate grid%n_iup_adh. ') endif ENDIF IF ( ASSOCIATED( grid%n_iup_adv ) ) THEN DEALLOCATE(grid%n_iup_adv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5682,& 'frame/module_domain.f: Failed to deallocate grid%n_iup_adv. ') endif ENDIF IF ( ASSOCIATED( grid%iup_h ) ) THEN DEALLOCATE(grid%iup_h,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5689,& 'frame/module_domain.f: Failed to deallocate grid%iup_h. ') endif ENDIF IF ( ASSOCIATED( grid%iup_v ) ) THEN DEALLOCATE(grid%iup_v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5696,& 'frame/module_domain.f: Failed to deallocate grid%iup_v. ') endif ENDIF IF ( ASSOCIATED( grid%iup_adh ) ) THEN DEALLOCATE(grid%iup_adh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5703,& 'frame/module_domain.f: Failed to deallocate grid%iup_adh. ') endif ENDIF IF ( ASSOCIATED( grid%iup_adv ) ) THEN DEALLOCATE(grid%iup_adv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5710,& 'frame/module_domain.f: Failed to deallocate grid%iup_adv. ') endif ENDIF IF ( ASSOCIATED( grid%winfo ) ) THEN DEALLOCATE(grid%winfo,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5717,& 'frame/module_domain.f: Failed to deallocate grid%winfo. ') endif ENDIF IF ( ASSOCIATED( grid%winfo_bxs ) ) THEN DEALLOCATE(grid%winfo_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5724,& 'frame/module_domain.f: Failed to deallocate grid%winfo_bxs. ') endif NULLIFY(grid%winfo_bxs) ENDIF IF ( ASSOCIATED( grid%winfo_bxe ) ) THEN DEALLOCATE(grid%winfo_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5732,& 'frame/module_domain.f: Failed to deallocate grid%winfo_bxe. ') endif NULLIFY(grid%winfo_bxe) ENDIF IF ( ASSOCIATED( grid%winfo_bys ) ) THEN DEALLOCATE(grid%winfo_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5740,& 'frame/module_domain.f: Failed to deallocate grid%winfo_bys. ') endif NULLIFY(grid%winfo_bys) ENDIF IF ( ASSOCIATED( grid%winfo_bye ) ) THEN DEALLOCATE(grid%winfo_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5748,& 'frame/module_domain.f: Failed to deallocate grid%winfo_bye. ') endif NULLIFY(grid%winfo_bye) ENDIF IF ( ASSOCIATED( grid%winfo_btxs ) ) THEN DEALLOCATE(grid%winfo_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5756,& 'frame/module_domain.f: Failed to deallocate grid%winfo_btxs. ') endif NULLIFY(grid%winfo_btxs) ENDIF IF ( ASSOCIATED( grid%winfo_btxe ) ) THEN DEALLOCATE(grid%winfo_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5764,& 'frame/module_domain.f: Failed to deallocate grid%winfo_btxe. ') endif NULLIFY(grid%winfo_btxe) ENDIF IF ( ASSOCIATED( grid%winfo_btys ) ) THEN DEALLOCATE(grid%winfo_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5772,& 'frame/module_domain.f: Failed to deallocate grid%winfo_btys. ') endif NULLIFY(grid%winfo_btys) ENDIF IF ( ASSOCIATED( grid%winfo_btye ) ) THEN DEALLOCATE(grid%winfo_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5780,& 'frame/module_domain.f: Failed to deallocate grid%winfo_btye. ') endif NULLIFY(grid%winfo_btye) ENDIF IF ( ASSOCIATED( grid%iinfo ) ) THEN DEALLOCATE(grid%iinfo,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5788,& 'frame/module_domain.f: Failed to deallocate grid%iinfo. ') endif ENDIF IF ( ASSOCIATED( grid%iinfo_bxs ) ) THEN DEALLOCATE(grid%iinfo_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5795,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_bxs. ') endif NULLIFY(grid%iinfo_bxs) ENDIF IF ( ASSOCIATED( grid%iinfo_bxe ) ) THEN DEALLOCATE(grid%iinfo_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5803,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_bxe. ') endif NULLIFY(grid%iinfo_bxe) ENDIF IF ( ASSOCIATED( grid%iinfo_bys ) ) THEN DEALLOCATE(grid%iinfo_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5811,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_bys. ') endif NULLIFY(grid%iinfo_bys) ENDIF IF ( ASSOCIATED( grid%iinfo_bye ) ) THEN DEALLOCATE(grid%iinfo_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5819,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_bye. ') endif NULLIFY(grid%iinfo_bye) ENDIF IF ( ASSOCIATED( grid%iinfo_btxs ) ) THEN DEALLOCATE(grid%iinfo_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5827,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_btxs. ') endif NULLIFY(grid%iinfo_btxs) ENDIF IF ( ASSOCIATED( grid%iinfo_btxe ) ) THEN DEALLOCATE(grid%iinfo_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5835,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_btxe. ') endif NULLIFY(grid%iinfo_btxe) ENDIF IF ( ASSOCIATED( grid%iinfo_btys ) ) THEN DEALLOCATE(grid%iinfo_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5843,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_btys. ') endif NULLIFY(grid%iinfo_btys) ENDIF IF ( ASSOCIATED( grid%iinfo_btye ) ) THEN DEALLOCATE(grid%iinfo_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5851,& 'frame/module_domain.f: Failed to deallocate grid%iinfo_btye. ') endif NULLIFY(grid%iinfo_btye) ENDIF IF ( ASSOCIATED( grid%imask_nostag ) ) THEN DEALLOCATE(grid%imask_nostag,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5859,& 'frame/module_domain.f: Failed to deallocate grid%imask_nostag. ') endif ENDIF IF ( ASSOCIATED( grid%imask_xstag ) ) THEN DEALLOCATE(grid%imask_xstag,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5866,& 'frame/module_domain.f: Failed to deallocate grid%imask_xstag. ') endif ENDIF IF ( ASSOCIATED( grid%imask_ystag ) ) THEN DEALLOCATE(grid%imask_ystag,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5873,& 'frame/module_domain.f: Failed to deallocate grid%imask_ystag. ') endif ENDIF IF ( ASSOCIATED( grid%imask_xystag ) ) THEN DEALLOCATE(grid%imask_xystag,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5880,& 'frame/module_domain.f: Failed to deallocate grid%imask_xystag. ') endif ENDIF IF ( ASSOCIATED( grid%sm000007 ) ) THEN DEALLOCATE(grid%sm000007,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5887,& 'frame/module_domain.f: Failed to deallocate grid%sm000007. ') endif ENDIF IF ( ASSOCIATED( grid%sm007028 ) ) THEN DEALLOCATE(grid%sm007028,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5894,& 'frame/module_domain.f: Failed to deallocate grid%sm007028. ') endif ENDIF IF ( ASSOCIATED( grid%sm028100 ) ) THEN DEALLOCATE(grid%sm028100,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5901,& 'frame/module_domain.f: Failed to deallocate grid%sm028100. ') endif ENDIF IF ( ASSOCIATED( grid%sm100255 ) ) THEN DEALLOCATE(grid%sm100255,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5908,& 'frame/module_domain.f: Failed to deallocate grid%sm100255. ') endif ENDIF IF ( ASSOCIATED( grid%st000007 ) ) THEN DEALLOCATE(grid%st000007,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5915,& 'frame/module_domain.f: Failed to deallocate grid%st000007. ') endif ENDIF IF ( ASSOCIATED( grid%st007028 ) ) THEN DEALLOCATE(grid%st007028,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5922,& 'frame/module_domain.f: Failed to deallocate grid%st007028. ') endif ENDIF IF ( ASSOCIATED( grid%st028100 ) ) THEN DEALLOCATE(grid%st028100,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5929,& 'frame/module_domain.f: Failed to deallocate grid%st028100. ') endif ENDIF IF ( ASSOCIATED( grid%st100255 ) ) THEN DEALLOCATE(grid%st100255,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5936,& 'frame/module_domain.f: Failed to deallocate grid%st100255. ') endif ENDIF IF ( ASSOCIATED( grid%sm000010 ) ) THEN DEALLOCATE(grid%sm000010,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5943,& 'frame/module_domain.f: Failed to deallocate grid%sm000010. ') endif ENDIF IF ( ASSOCIATED( grid%sm010040 ) ) THEN DEALLOCATE(grid%sm010040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5950,& 'frame/module_domain.f: Failed to deallocate grid%sm010040. ') endif ENDIF IF ( ASSOCIATED( grid%sm040100 ) ) THEN DEALLOCATE(grid%sm040100,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5957,& 'frame/module_domain.f: Failed to deallocate grid%sm040100. ') endif ENDIF IF ( ASSOCIATED( grid%sm100200 ) ) THEN DEALLOCATE(grid%sm100200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5964,& 'frame/module_domain.f: Failed to deallocate grid%sm100200. ') endif ENDIF IF ( ASSOCIATED( grid%sm010200 ) ) THEN DEALLOCATE(grid%sm010200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5971,& 'frame/module_domain.f: Failed to deallocate grid%sm010200. ') endif ENDIF IF ( ASSOCIATED( grid%soilm000 ) ) THEN DEALLOCATE(grid%soilm000,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5978,& 'frame/module_domain.f: Failed to deallocate grid%soilm000. ') endif ENDIF IF ( ASSOCIATED( grid%soilm005 ) ) THEN DEALLOCATE(grid%soilm005,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5985,& 'frame/module_domain.f: Failed to deallocate grid%soilm005. ') endif ENDIF IF ( ASSOCIATED( grid%soilm020 ) ) THEN DEALLOCATE(grid%soilm020,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5992,& 'frame/module_domain.f: Failed to deallocate grid%soilm020. ') endif ENDIF IF ( ASSOCIATED( grid%soilm040 ) ) THEN DEALLOCATE(grid%soilm040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",5999,& 'frame/module_domain.f: Failed to deallocate grid%soilm040. ') endif ENDIF IF ( ASSOCIATED( grid%soilm160 ) ) THEN DEALLOCATE(grid%soilm160,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6006,& 'frame/module_domain.f: Failed to deallocate grid%soilm160. ') endif ENDIF IF ( ASSOCIATED( grid%soilm300 ) ) THEN DEALLOCATE(grid%soilm300,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6013,& 'frame/module_domain.f: Failed to deallocate grid%soilm300. ') endif ENDIF IF ( ASSOCIATED( grid%sw000010 ) ) THEN DEALLOCATE(grid%sw000010,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6020,& 'frame/module_domain.f: Failed to deallocate grid%sw000010. ') endif ENDIF IF ( ASSOCIATED( grid%sw010040 ) ) THEN DEALLOCATE(grid%sw010040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6027,& 'frame/module_domain.f: Failed to deallocate grid%sw010040. ') endif ENDIF IF ( ASSOCIATED( grid%sw040100 ) ) THEN DEALLOCATE(grid%sw040100,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6034,& 'frame/module_domain.f: Failed to deallocate grid%sw040100. ') endif ENDIF IF ( ASSOCIATED( grid%sw100200 ) ) THEN DEALLOCATE(grid%sw100200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6041,& 'frame/module_domain.f: Failed to deallocate grid%sw100200. ') endif ENDIF IF ( ASSOCIATED( grid%sw010200 ) ) THEN DEALLOCATE(grid%sw010200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6048,& 'frame/module_domain.f: Failed to deallocate grid%sw010200. ') endif ENDIF IF ( ASSOCIATED( grid%soilw000 ) ) THEN DEALLOCATE(grid%soilw000,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6055,& 'frame/module_domain.f: Failed to deallocate grid%soilw000. ') endif ENDIF IF ( ASSOCIATED( grid%soilw005 ) ) THEN DEALLOCATE(grid%soilw005,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6062,& 'frame/module_domain.f: Failed to deallocate grid%soilw005. ') endif ENDIF IF ( ASSOCIATED( grid%soilw020 ) ) THEN DEALLOCATE(grid%soilw020,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6069,& 'frame/module_domain.f: Failed to deallocate grid%soilw020. ') endif ENDIF IF ( ASSOCIATED( grid%soilw040 ) ) THEN DEALLOCATE(grid%soilw040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6076,& 'frame/module_domain.f: Failed to deallocate grid%soilw040. ') endif ENDIF IF ( ASSOCIATED( grid%soilw160 ) ) THEN DEALLOCATE(grid%soilw160,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6083,& 'frame/module_domain.f: Failed to deallocate grid%soilw160. ') endif ENDIF IF ( ASSOCIATED( grid%soilw300 ) ) THEN DEALLOCATE(grid%soilw300,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6090,& 'frame/module_domain.f: Failed to deallocate grid%soilw300. ') endif ENDIF IF ( ASSOCIATED( grid%st000010 ) ) THEN DEALLOCATE(grid%st000010,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6097,& 'frame/module_domain.f: Failed to deallocate grid%st000010. ') endif ENDIF IF ( ASSOCIATED( grid%st010040 ) ) THEN DEALLOCATE(grid%st010040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6104,& 'frame/module_domain.f: Failed to deallocate grid%st010040. ') endif ENDIF IF ( ASSOCIATED( grid%st040100 ) ) THEN DEALLOCATE(grid%st040100,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6111,& 'frame/module_domain.f: Failed to deallocate grid%st040100. ') endif ENDIF IF ( ASSOCIATED( grid%st100200 ) ) THEN DEALLOCATE(grid%st100200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6118,& 'frame/module_domain.f: Failed to deallocate grid%st100200. ') endif ENDIF IF ( ASSOCIATED( grid%st010200 ) ) THEN DEALLOCATE(grid%st010200,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6125,& 'frame/module_domain.f: Failed to deallocate grid%st010200. ') endif ENDIF IF ( ASSOCIATED( grid%soilt000 ) ) THEN DEALLOCATE(grid%soilt000,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6132,& 'frame/module_domain.f: Failed to deallocate grid%soilt000. ') endif ENDIF IF ( ASSOCIATED( grid%soilt005 ) ) THEN DEALLOCATE(grid%soilt005,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6139,& 'frame/module_domain.f: Failed to deallocate grid%soilt005. ') endif ENDIF IF ( ASSOCIATED( grid%soilt020 ) ) THEN DEALLOCATE(grid%soilt020,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6146,& 'frame/module_domain.f: Failed to deallocate grid%soilt020. ') endif ENDIF IF ( ASSOCIATED( grid%soilt040 ) ) THEN DEALLOCATE(grid%soilt040,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6153,& 'frame/module_domain.f: Failed to deallocate grid%soilt040. ') endif ENDIF IF ( ASSOCIATED( grid%soilt160 ) ) THEN DEALLOCATE(grid%soilt160,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6160,& 'frame/module_domain.f: Failed to deallocate grid%soilt160. ') endif ENDIF IF ( ASSOCIATED( grid%soilt300 ) ) THEN DEALLOCATE(grid%soilt300,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6167,& 'frame/module_domain.f: Failed to deallocate grid%soilt300. ') endif ENDIF IF ( ASSOCIATED( grid%landmask ) ) THEN DEALLOCATE(grid%landmask,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6174,& 'frame/module_domain.f: Failed to deallocate grid%landmask. ') endif ENDIF IF ( ASSOCIATED( grid%topostdv ) ) THEN DEALLOCATE(grid%topostdv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6181,& 'frame/module_domain.f: Failed to deallocate grid%topostdv. ') endif ENDIF IF ( ASSOCIATED( grid%toposlpx ) ) THEN DEALLOCATE(grid%toposlpx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6188,& 'frame/module_domain.f: Failed to deallocate grid%toposlpx. ') endif ENDIF IF ( ASSOCIATED( grid%toposlpy ) ) THEN DEALLOCATE(grid%toposlpy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6195,& 'frame/module_domain.f: Failed to deallocate grid%toposlpy. ') endif ENDIF IF ( ASSOCIATED( grid%greenmax ) ) THEN DEALLOCATE(grid%greenmax,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6202,& 'frame/module_domain.f: Failed to deallocate grid%greenmax. ') endif ENDIF IF ( ASSOCIATED( grid%greenmin ) ) THEN DEALLOCATE(grid%greenmin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6209,& 'frame/module_domain.f: Failed to deallocate grid%greenmin. ') endif ENDIF IF ( ASSOCIATED( grid%albedomx ) ) THEN DEALLOCATE(grid%albedomx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6216,& 'frame/module_domain.f: Failed to deallocate grid%albedomx. ') endif ENDIF IF ( ASSOCIATED( grid%slopecat ) ) THEN DEALLOCATE(grid%slopecat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6223,& 'frame/module_domain.f: Failed to deallocate grid%slopecat. ') endif ENDIF IF ( ASSOCIATED( grid%toposoil ) ) THEN DEALLOCATE(grid%toposoil,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6230,& 'frame/module_domain.f: Failed to deallocate grid%toposoil. ') endif ENDIF IF ( ASSOCIATED( grid%landusef ) ) THEN DEALLOCATE(grid%landusef,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6237,& 'frame/module_domain.f: Failed to deallocate grid%landusef. ') endif ENDIF IF ( ASSOCIATED( grid%soilctop ) ) THEN DEALLOCATE(grid%soilctop,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6244,& 'frame/module_domain.f: Failed to deallocate grid%soilctop. ') endif ENDIF IF ( ASSOCIATED( grid%soilcbot ) ) THEN DEALLOCATE(grid%soilcbot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6251,& 'frame/module_domain.f: Failed to deallocate grid%soilcbot. ') endif ENDIF IF ( ASSOCIATED( grid%ts_hour ) ) THEN DEALLOCATE(grid%ts_hour,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6258,& 'frame/module_domain.f: Failed to deallocate grid%ts_hour. ') endif ENDIF IF ( ASSOCIATED( grid%ts_u ) ) THEN DEALLOCATE(grid%ts_u,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6265,& 'frame/module_domain.f: Failed to deallocate grid%ts_u. ') endif ENDIF IF ( ASSOCIATED( grid%ts_v ) ) THEN DEALLOCATE(grid%ts_v,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6272,& 'frame/module_domain.f: Failed to deallocate grid%ts_v. ') endif ENDIF IF ( ASSOCIATED( grid%ts_q ) ) THEN DEALLOCATE(grid%ts_q,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6279,& 'frame/module_domain.f: Failed to deallocate grid%ts_q. ') endif ENDIF IF ( ASSOCIATED( grid%ts_t ) ) THEN DEALLOCATE(grid%ts_t,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6286,& 'frame/module_domain.f: Failed to deallocate grid%ts_t. ') endif ENDIF IF ( ASSOCIATED( grid%ts_psfc ) ) THEN DEALLOCATE(grid%ts_psfc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6293,& 'frame/module_domain.f: Failed to deallocate grid%ts_psfc. ') endif ENDIF IF ( ASSOCIATED( grid%ts_tsk ) ) THEN DEALLOCATE(grid%ts_tsk,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6300,& 'frame/module_domain.f: Failed to deallocate grid%ts_tsk. ') endif ENDIF IF ( ASSOCIATED( grid%ts_tslb ) ) THEN DEALLOCATE(grid%ts_tslb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6307,& 'frame/module_domain.f: Failed to deallocate grid%ts_tslb. ') endif ENDIF IF ( ASSOCIATED( grid%ts_clw ) ) THEN DEALLOCATE(grid%ts_clw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6314,& 'frame/module_domain.f: Failed to deallocate grid%ts_clw. ') endif ENDIF IF ( ASSOCIATED( grid%moist ) ) THEN DEALLOCATE(grid%moist,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6321,& 'frame/module_domain.f: Failed to deallocate grid%moist. ') endif ENDIF IF ( ASSOCIATED( grid%moist_bxs ) ) THEN DEALLOCATE(grid%moist_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6328,& 'frame/module_domain.f: Failed to deallocate grid%moist_bxs. ') endif NULLIFY(grid%moist_bxs) ENDIF IF ( ASSOCIATED( grid%moist_bxe ) ) THEN DEALLOCATE(grid%moist_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6336,& 'frame/module_domain.f: Failed to deallocate grid%moist_bxe. ') endif NULLIFY(grid%moist_bxe) ENDIF IF ( ASSOCIATED( grid%moist_bys ) ) THEN DEALLOCATE(grid%moist_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6344,& 'frame/module_domain.f: Failed to deallocate grid%moist_bys. ') endif NULLIFY(grid%moist_bys) ENDIF IF ( ASSOCIATED( grid%moist_bye ) ) THEN DEALLOCATE(grid%moist_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6352,& 'frame/module_domain.f: Failed to deallocate grid%moist_bye. ') endif NULLIFY(grid%moist_bye) ENDIF IF ( ASSOCIATED( grid%moist_btxs ) ) THEN DEALLOCATE(grid%moist_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6360,& 'frame/module_domain.f: Failed to deallocate grid%moist_btxs. ') endif NULLIFY(grid%moist_btxs) ENDIF IF ( ASSOCIATED( grid%moist_btxe ) ) THEN DEALLOCATE(grid%moist_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6368,& 'frame/module_domain.f: Failed to deallocate grid%moist_btxe. ') endif NULLIFY(grid%moist_btxe) ENDIF IF ( ASSOCIATED( grid%moist_btys ) ) THEN DEALLOCATE(grid%moist_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6376,& 'frame/module_domain.f: Failed to deallocate grid%moist_btys. ') endif NULLIFY(grid%moist_btys) ENDIF IF ( ASSOCIATED( grid%moist_btye ) ) THEN DEALLOCATE(grid%moist_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6384,& 'frame/module_domain.f: Failed to deallocate grid%moist_btye. ') endif NULLIFY(grid%moist_btye) ENDIF IF ( ASSOCIATED( grid%dfi_moist ) ) THEN DEALLOCATE(grid%dfi_moist,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6392,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_moist_bxs ) ) THEN DEALLOCATE(grid%dfi_moist_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6399,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_bxs. ') endif NULLIFY(grid%dfi_moist_bxs) ENDIF IF ( ASSOCIATED( grid%dfi_moist_bxe ) ) THEN DEALLOCATE(grid%dfi_moist_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6407,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_bxe. ') endif NULLIFY(grid%dfi_moist_bxe) ENDIF IF ( ASSOCIATED( grid%dfi_moist_bys ) ) THEN DEALLOCATE(grid%dfi_moist_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6415,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_bys. ') endif NULLIFY(grid%dfi_moist_bys) ENDIF IF ( ASSOCIATED( grid%dfi_moist_bye ) ) THEN DEALLOCATE(grid%dfi_moist_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6423,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_bye. ') endif NULLIFY(grid%dfi_moist_bye) ENDIF IF ( ASSOCIATED( grid%dfi_moist_btxs ) ) THEN DEALLOCATE(grid%dfi_moist_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6431,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_btxs. ') endif NULLIFY(grid%dfi_moist_btxs) ENDIF IF ( ASSOCIATED( grid%dfi_moist_btxe ) ) THEN DEALLOCATE(grid%dfi_moist_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6439,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_btxe. ') endif NULLIFY(grid%dfi_moist_btxe) ENDIF IF ( ASSOCIATED( grid%dfi_moist_btys ) ) THEN DEALLOCATE(grid%dfi_moist_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6447,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_btys. ') endif NULLIFY(grid%dfi_moist_btys) ENDIF IF ( ASSOCIATED( grid%dfi_moist_btye ) ) THEN DEALLOCATE(grid%dfi_moist_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6455,& 'frame/module_domain.f: Failed to deallocate grid%dfi_moist_btye. ') endif NULLIFY(grid%dfi_moist_btye) ENDIF IF ( ASSOCIATED( grid%scalar ) ) THEN DEALLOCATE(grid%scalar,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6463,& 'frame/module_domain.f: Failed to deallocate grid%scalar. ') endif ENDIF IF ( ASSOCIATED( grid%scalar_bxs ) ) THEN DEALLOCATE(grid%scalar_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6470,& 'frame/module_domain.f: Failed to deallocate grid%scalar_bxs. ') endif NULLIFY(grid%scalar_bxs) ENDIF IF ( ASSOCIATED( grid%scalar_bxe ) ) THEN DEALLOCATE(grid%scalar_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6478,& 'frame/module_domain.f: Failed to deallocate grid%scalar_bxe. ') endif NULLIFY(grid%scalar_bxe) ENDIF IF ( ASSOCIATED( grid%scalar_bys ) ) THEN DEALLOCATE(grid%scalar_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6486,& 'frame/module_domain.f: Failed to deallocate grid%scalar_bys. ') endif NULLIFY(grid%scalar_bys) ENDIF IF ( ASSOCIATED( grid%scalar_bye ) ) THEN DEALLOCATE(grid%scalar_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6494,& 'frame/module_domain.f: Failed to deallocate grid%scalar_bye. ') endif NULLIFY(grid%scalar_bye) ENDIF IF ( ASSOCIATED( grid%scalar_btxs ) ) THEN DEALLOCATE(grid%scalar_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6502,& 'frame/module_domain.f: Failed to deallocate grid%scalar_btxs. ') endif NULLIFY(grid%scalar_btxs) ENDIF IF ( ASSOCIATED( grid%scalar_btxe ) ) THEN DEALLOCATE(grid%scalar_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6510,& 'frame/module_domain.f: Failed to deallocate grid%scalar_btxe. ') endif NULLIFY(grid%scalar_btxe) ENDIF IF ( ASSOCIATED( grid%scalar_btys ) ) THEN DEALLOCATE(grid%scalar_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6518,& 'frame/module_domain.f: Failed to deallocate grid%scalar_btys. ') endif NULLIFY(grid%scalar_btys) ENDIF IF ( ASSOCIATED( grid%scalar_btye ) ) THEN DEALLOCATE(grid%scalar_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6526,& 'frame/module_domain.f: Failed to deallocate grid%scalar_btye. ') endif NULLIFY(grid%scalar_btye) ENDIF IF ( ASSOCIATED( grid%dfi_scalar ) ) THEN DEALLOCATE(grid%dfi_scalar,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6534,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar. ') endif ENDIF IF ( ASSOCIATED( grid%dfi_scalar_bxs ) ) THEN DEALLOCATE(grid%dfi_scalar_bxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6541,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_bxs. ') endif NULLIFY(grid%dfi_scalar_bxs) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_bxe ) ) THEN DEALLOCATE(grid%dfi_scalar_bxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6549,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_bxe. ') endif NULLIFY(grid%dfi_scalar_bxe) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_bys ) ) THEN DEALLOCATE(grid%dfi_scalar_bys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6557,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_bys. ') endif NULLIFY(grid%dfi_scalar_bys) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_bye ) ) THEN DEALLOCATE(grid%dfi_scalar_bye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6565,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_bye. ') endif NULLIFY(grid%dfi_scalar_bye) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_btxs ) ) THEN DEALLOCATE(grid%dfi_scalar_btxs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6573,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_btxs. ') endif NULLIFY(grid%dfi_scalar_btxs) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_btxe ) ) THEN DEALLOCATE(grid%dfi_scalar_btxe,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6581,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_btxe. ') endif NULLIFY(grid%dfi_scalar_btxe) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_btys ) ) THEN DEALLOCATE(grid%dfi_scalar_btys,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6589,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_btys. ') endif NULLIFY(grid%dfi_scalar_btys) ENDIF IF ( ASSOCIATED( grid%dfi_scalar_btye ) ) THEN DEALLOCATE(grid%dfi_scalar_btye,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6597,& 'frame/module_domain.f: Failed to deallocate grid%dfi_scalar_btye. ') endif NULLIFY(grid%dfi_scalar_btye) ENDIF IF ( ASSOCIATED( grid%chem ) ) THEN DEALLOCATE(grid%chem,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6605,& 'frame/module_domain.f: Failed to deallocate grid%chem. ') endif ENDIF IF ( ASSOCIATED( grid%smois ) ) THEN DEALLOCATE(grid%smois,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6612,& 'frame/module_domain.f: Failed to deallocate grid%smois. ') endif ENDIF IF ( ASSOCIATED( grid%tslb ) ) THEN DEALLOCATE(grid%tslb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6619,& 'frame/module_domain.f: Failed to deallocate grid%tslb. ') endif ENDIF IF ( ASSOCIATED( grid%lake_depth ) ) THEN DEALLOCATE(grid%lake_depth,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6626,& 'frame/module_domain.f: Failed to deallocate grid%lake_depth. ') endif ENDIF IF ( ASSOCIATED( grid%gsw ) ) THEN DEALLOCATE(grid%gsw,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6633,& 'frame/module_domain.f: Failed to deallocate grid%gsw. ') endif ENDIF IF ( ASSOCIATED( grid%xland ) ) THEN DEALLOCATE(grid%xland,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6640,& 'frame/module_domain.f: Failed to deallocate grid%xland. ') endif ENDIF IF ( ASSOCIATED( grid%raincv ) ) THEN DEALLOCATE(grid%raincv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6647,& 'frame/module_domain.f: Failed to deallocate grid%raincv. ') endif ENDIF IF ( ASSOCIATED( grid%rainsh ) ) THEN DEALLOCATE(grid%rainsh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6654,& 'frame/module_domain.f: Failed to deallocate grid%rainsh. ') endif ENDIF IF ( ASSOCIATED( grid%rainshv ) ) THEN DEALLOCATE(grid%rainshv,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6661,& 'frame/module_domain.f: Failed to deallocate grid%rainshv. ') endif ENDIF IF ( ASSOCIATED( grid%shall ) ) THEN DEALLOCATE(grid%shall,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6668,& 'frame/module_domain.f: Failed to deallocate grid%shall. ') endif ENDIF IF ( ASSOCIATED( grid%psfc ) ) THEN DEALLOCATE(grid%psfc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6675,& 'frame/module_domain.f: Failed to deallocate grid%psfc. ') endif ENDIF IF ( ASSOCIATED( grid%th2 ) ) THEN DEALLOCATE(grid%th2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6682,& 'frame/module_domain.f: Failed to deallocate grid%th2. ') endif ENDIF IF ( ASSOCIATED( grid%t2 ) ) THEN DEALLOCATE(grid%t2,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6689,& 'frame/module_domain.f: Failed to deallocate grid%t2. ') endif ENDIF IF ( ASSOCIATED( grid%u10 ) ) THEN DEALLOCATE(grid%u10,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6696,& 'frame/module_domain.f: Failed to deallocate grid%u10. ') endif ENDIF IF ( ASSOCIATED( grid%v10 ) ) THEN DEALLOCATE(grid%v10,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6703,& 'frame/module_domain.f: Failed to deallocate grid%v10. ') endif ENDIF IF ( ASSOCIATED( grid%xice ) ) THEN DEALLOCATE(grid%xice,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6710,& 'frame/module_domain.f: Failed to deallocate grid%xice. ') endif ENDIF IF ( ASSOCIATED( grid%icedepth ) ) THEN DEALLOCATE(grid%icedepth,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6717,& 'frame/module_domain.f: Failed to deallocate grid%icedepth. ') endif ENDIF IF ( ASSOCIATED( grid%albsi ) ) THEN DEALLOCATE(grid%albsi,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6724,& 'frame/module_domain.f: Failed to deallocate grid%albsi. ') endif ENDIF IF ( ASSOCIATED( grid%snowsi ) ) THEN DEALLOCATE(grid%snowsi,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6731,& 'frame/module_domain.f: Failed to deallocate grid%snowsi. ') endif ENDIF IF ( ASSOCIATED( grid%lai ) ) THEN DEALLOCATE(grid%lai,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6738,& 'frame/module_domain.f: Failed to deallocate grid%lai. ') endif ENDIF IF ( ASSOCIATED( grid%smstav ) ) THEN DEALLOCATE(grid%smstav,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6745,& 'frame/module_domain.f: Failed to deallocate grid%smstav. ') endif ENDIF IF ( ASSOCIATED( grid%smstot ) ) THEN DEALLOCATE(grid%smstot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6752,& 'frame/module_domain.f: Failed to deallocate grid%smstot. ') endif ENDIF IF ( ASSOCIATED( grid%soldrain ) ) THEN DEALLOCATE(grid%soldrain,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6759,& 'frame/module_domain.f: Failed to deallocate grid%soldrain. ') endif ENDIF IF ( ASSOCIATED( grid%sfcheadrt ) ) THEN DEALLOCATE(grid%sfcheadrt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6766,& 'frame/module_domain.f: Failed to deallocate grid%sfcheadrt. ') endif ENDIF IF ( ASSOCIATED( grid%infxsrt ) ) THEN DEALLOCATE(grid%infxsrt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6773,& 'frame/module_domain.f: Failed to deallocate grid%infxsrt. ') endif ENDIF IF ( ASSOCIATED( grid%sfcrunoff ) ) THEN DEALLOCATE(grid%sfcrunoff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6780,& 'frame/module_domain.f: Failed to deallocate grid%sfcrunoff. ') endif ENDIF IF ( ASSOCIATED( grid%udrunoff ) ) THEN DEALLOCATE(grid%udrunoff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6787,& 'frame/module_domain.f: Failed to deallocate grid%udrunoff. ') endif ENDIF IF ( ASSOCIATED( grid%ivgtyp ) ) THEN DEALLOCATE(grid%ivgtyp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6794,& 'frame/module_domain.f: Failed to deallocate grid%ivgtyp. ') endif ENDIF IF ( ASSOCIATED( grid%isltyp ) ) THEN DEALLOCATE(grid%isltyp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6801,& 'frame/module_domain.f: Failed to deallocate grid%isltyp. ') endif ENDIF IF ( ASSOCIATED( grid%vegfra ) ) THEN DEALLOCATE(grid%vegfra,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6808,& 'frame/module_domain.f: Failed to deallocate grid%vegfra. ') endif ENDIF IF ( ASSOCIATED( grid%sfcevp ) ) THEN DEALLOCATE(grid%sfcevp,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6815,& 'frame/module_domain.f: Failed to deallocate grid%sfcevp. ') endif ENDIF IF ( ASSOCIATED( grid%grdflx ) ) THEN DEALLOCATE(grid%grdflx,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6822,& 'frame/module_domain.f: Failed to deallocate grid%grdflx. ') endif ENDIF IF ( ASSOCIATED( grid%albbck ) ) THEN DEALLOCATE(grid%albbck,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6829,& 'frame/module_domain.f: Failed to deallocate grid%albbck. ') endif ENDIF IF ( ASSOCIATED( grid%sfcexc ) ) THEN DEALLOCATE(grid%sfcexc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6836,& 'frame/module_domain.f: Failed to deallocate grid%sfcexc. ') endif ENDIF IF ( ASSOCIATED( grid%snotime ) ) THEN DEALLOCATE(grid%snotime,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6843,& 'frame/module_domain.f: Failed to deallocate grid%snotime. ') endif ENDIF IF ( ASSOCIATED( grid%acrunoff ) ) THEN DEALLOCATE(grid%acrunoff,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6850,& 'frame/module_domain.f: Failed to deallocate grid%acrunoff. ') endif ENDIF IF ( ASSOCIATED( grid%acsnow ) ) THEN DEALLOCATE(grid%acsnow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6857,& 'frame/module_domain.f: Failed to deallocate grid%acsnow. ') endif ENDIF IF ( ASSOCIATED( grid%acsnom ) ) THEN DEALLOCATE(grid%acsnom,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6864,& 'frame/module_domain.f: Failed to deallocate grid%acsnom. ') endif ENDIF IF ( ASSOCIATED( grid%rmol ) ) THEN DEALLOCATE(grid%rmol,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6871,& 'frame/module_domain.f: Failed to deallocate grid%rmol. ') endif ENDIF IF ( ASSOCIATED( grid%snow ) ) THEN DEALLOCATE(grid%snow,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6878,& 'frame/module_domain.f: Failed to deallocate grid%snow. ') endif ENDIF IF ( ASSOCIATED( grid%canwat ) ) THEN DEALLOCATE(grid%canwat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6885,& 'frame/module_domain.f: Failed to deallocate grid%canwat. ') endif ENDIF IF ( ASSOCIATED( grid%force_sst ) ) THEN DEALLOCATE(grid%force_sst,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6892,& 'frame/module_domain.f: Failed to deallocate grid%force_sst. ') endif ENDIF IF ( ASSOCIATED( grid%sst ) ) THEN DEALLOCATE(grid%sst,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6899,& 'frame/module_domain.f: Failed to deallocate grid%sst. ') endif ENDIF IF ( ASSOCIATED( grid%uoce ) ) THEN DEALLOCATE(grid%uoce,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6906,& 'frame/module_domain.f: Failed to deallocate grid%uoce. ') endif ENDIF IF ( ASSOCIATED( grid%voce ) ) THEN DEALLOCATE(grid%voce,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6913,& 'frame/module_domain.f: Failed to deallocate grid%voce. ') endif ENDIF IF ( ASSOCIATED( grid%weasd ) ) THEN DEALLOCATE(grid%weasd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6920,& 'frame/module_domain.f: Failed to deallocate grid%weasd. ') endif ENDIF IF ( ASSOCIATED( grid%znt ) ) THEN DEALLOCATE(grid%znt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6927,& 'frame/module_domain.f: Failed to deallocate grid%znt. ') endif ENDIF IF ( ASSOCIATED( grid%mol ) ) THEN DEALLOCATE(grid%mol,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6934,& 'frame/module_domain.f: Failed to deallocate grid%mol. ') endif ENDIF IF ( ASSOCIATED( grid%noahres ) ) THEN DEALLOCATE(grid%noahres,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6941,& 'frame/module_domain.f: Failed to deallocate grid%noahres. ') endif ENDIF IF ( ASSOCIATED( grid%tke_pbl ) ) THEN DEALLOCATE(grid%tke_pbl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6948,& 'frame/module_domain.f: Failed to deallocate grid%tke_pbl. ') endif ENDIF IF ( ASSOCIATED( grid%el_pbl ) ) THEN DEALLOCATE(grid%el_pbl,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6955,& 'frame/module_domain.f: Failed to deallocate grid%el_pbl. ') endif ENDIF IF ( ASSOCIATED( grid%exch_h ) ) THEN DEALLOCATE(grid%exch_h,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6962,& 'frame/module_domain.f: Failed to deallocate grid%exch_h. ') endif ENDIF IF ( ASSOCIATED( grid%exch_m ) ) THEN DEALLOCATE(grid%exch_m,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6969,& 'frame/module_domain.f: Failed to deallocate grid%exch_m. ') endif ENDIF IF ( ASSOCIATED( grid%thz0 ) ) THEN DEALLOCATE(grid%thz0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6976,& 'frame/module_domain.f: Failed to deallocate grid%thz0. ') endif ENDIF IF ( ASSOCIATED( grid%qz0 ) ) THEN DEALLOCATE(grid%qz0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6983,& 'frame/module_domain.f: Failed to deallocate grid%qz0. ') endif ENDIF IF ( ASSOCIATED( grid%uz0 ) ) THEN DEALLOCATE(grid%uz0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6990,& 'frame/module_domain.f: Failed to deallocate grid%uz0. ') endif ENDIF IF ( ASSOCIATED( grid%vz0 ) ) THEN DEALLOCATE(grid%vz0,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",6997,& 'frame/module_domain.f: Failed to deallocate grid%vz0. ') endif ENDIF IF ( ASSOCIATED( grid%flhc ) ) THEN DEALLOCATE(grid%flhc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7004,& 'frame/module_domain.f: Failed to deallocate grid%flhc. ') endif ENDIF IF ( ASSOCIATED( grid%flqc ) ) THEN DEALLOCATE(grid%flqc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7011,& 'frame/module_domain.f: Failed to deallocate grid%flqc. ') endif ENDIF IF ( ASSOCIATED( grid%qsg ) ) THEN DEALLOCATE(grid%qsg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7018,& 'frame/module_domain.f: Failed to deallocate grid%qsg. ') endif ENDIF IF ( ASSOCIATED( grid%qvg ) ) THEN DEALLOCATE(grid%qvg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7025,& 'frame/module_domain.f: Failed to deallocate grid%qvg. ') endif ENDIF IF ( ASSOCIATED( grid%qcg ) ) THEN DEALLOCATE(grid%qcg,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7032,& 'frame/module_domain.f: Failed to deallocate grid%qcg. ') endif ENDIF IF ( ASSOCIATED( grid%dew ) ) THEN DEALLOCATE(grid%dew,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7039,& 'frame/module_domain.f: Failed to deallocate grid%dew. ') endif ENDIF IF ( ASSOCIATED( grid%soilt1 ) ) THEN DEALLOCATE(grid%soilt1,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7046,& 'frame/module_domain.f: Failed to deallocate grid%soilt1. ') endif ENDIF IF ( ASSOCIATED( grid%tsnav ) ) THEN DEALLOCATE(grid%tsnav,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7053,& 'frame/module_domain.f: Failed to deallocate grid%tsnav. ') endif ENDIF IF ( ASSOCIATED( grid%psfc_out ) ) THEN DEALLOCATE(grid%psfc_out,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7060,& 'frame/module_domain.f: Failed to deallocate grid%psfc_out. ') endif ENDIF IF ( ASSOCIATED( grid%uz0h ) ) THEN DEALLOCATE(grid%uz0h,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7067,& 'frame/module_domain.f: Failed to deallocate grid%uz0h. ') endif ENDIF IF ( ASSOCIATED( grid%vz0h ) ) THEN DEALLOCATE(grid%vz0h,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7074,& 'frame/module_domain.f: Failed to deallocate grid%vz0h. ') endif ENDIF IF ( ASSOCIATED( grid%dudt ) ) THEN DEALLOCATE(grid%dudt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7081,& 'frame/module_domain.f: Failed to deallocate grid%dudt. ') endif ENDIF IF ( ASSOCIATED( grid%dvdt ) ) THEN DEALLOCATE(grid%dvdt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7088,& 'frame/module_domain.f: Failed to deallocate grid%dvdt. ') endif ENDIF IF ( ASSOCIATED( grid%qsfc ) ) THEN DEALLOCATE(grid%qsfc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7095,& 'frame/module_domain.f: Failed to deallocate grid%qsfc. ') endif ENDIF IF ( ASSOCIATED( grid%akhs ) ) THEN DEALLOCATE(grid%akhs,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7102,& 'frame/module_domain.f: Failed to deallocate grid%akhs. ') endif ENDIF IF ( ASSOCIATED( grid%akms ) ) THEN DEALLOCATE(grid%akms,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7109,& 'frame/module_domain.f: Failed to deallocate grid%akms. ') endif ENDIF IF ( ASSOCIATED( grid%htop ) ) THEN DEALLOCATE(grid%htop,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7116,& 'frame/module_domain.f: Failed to deallocate grid%htop. ') endif ENDIF IF ( ASSOCIATED( grid%hbot ) ) THEN DEALLOCATE(grid%hbot,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7123,& 'frame/module_domain.f: Failed to deallocate grid%hbot. ') endif ENDIF IF ( ASSOCIATED( grid%htopr ) ) THEN DEALLOCATE(grid%htopr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7130,& 'frame/module_domain.f: Failed to deallocate grid%htopr. ') endif ENDIF IF ( ASSOCIATED( grid%hbotr ) ) THEN DEALLOCATE(grid%hbotr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7137,& 'frame/module_domain.f: Failed to deallocate grid%hbotr. ') endif ENDIF IF ( ASSOCIATED( grid%htopd ) ) THEN DEALLOCATE(grid%htopd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7144,& 'frame/module_domain.f: Failed to deallocate grid%htopd. ') endif ENDIF IF ( ASSOCIATED( grid%hbotd ) ) THEN DEALLOCATE(grid%hbotd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7151,& 'frame/module_domain.f: Failed to deallocate grid%hbotd. ') endif ENDIF IF ( ASSOCIATED( grid%htops ) ) THEN DEALLOCATE(grid%htops,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7158,& 'frame/module_domain.f: Failed to deallocate grid%htops. ') endif ENDIF IF ( ASSOCIATED( grid%hbots ) ) THEN DEALLOCATE(grid%hbots,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7165,& 'frame/module_domain.f: Failed to deallocate grid%hbots. ') endif ENDIF IF ( ASSOCIATED( grid%cuppt ) ) THEN DEALLOCATE(grid%cuppt,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7172,& 'frame/module_domain.f: Failed to deallocate grid%cuppt. ') endif ENDIF IF ( ASSOCIATED( grid%cprate ) ) THEN DEALLOCATE(grid%cprate,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7179,& 'frame/module_domain.f: Failed to deallocate grid%cprate. ') endif ENDIF IF ( ASSOCIATED( grid%f_ice_phy ) ) THEN DEALLOCATE(grid%f_ice_phy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7186,& 'frame/module_domain.f: Failed to deallocate grid%f_ice_phy. ') endif ENDIF IF ( ASSOCIATED( grid%f_rain_phy ) ) THEN DEALLOCATE(grid%f_rain_phy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7193,& 'frame/module_domain.f: Failed to deallocate grid%f_rain_phy. ') endif ENDIF IF ( ASSOCIATED( grid%f_rimef_phy ) ) THEN DEALLOCATE(grid%f_rimef_phy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7200,& 'frame/module_domain.f: Failed to deallocate grid%f_rimef_phy. ') endif ENDIF IF ( ASSOCIATED( grid%mass_flux ) ) THEN DEALLOCATE(grid%mass_flux,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7207,& 'frame/module_domain.f: Failed to deallocate grid%mass_flux. ') endif ENDIF IF ( ASSOCIATED( grid%apr_gr ) ) THEN DEALLOCATE(grid%apr_gr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7214,& 'frame/module_domain.f: Failed to deallocate grid%apr_gr. ') endif ENDIF IF ( ASSOCIATED( grid%apr_w ) ) THEN DEALLOCATE(grid%apr_w,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7221,& 'frame/module_domain.f: Failed to deallocate grid%apr_w. ') endif ENDIF IF ( ASSOCIATED( grid%apr_mc ) ) THEN DEALLOCATE(grid%apr_mc,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7228,& 'frame/module_domain.f: Failed to deallocate grid%apr_mc. ') endif ENDIF IF ( ASSOCIATED( grid%apr_st ) ) THEN DEALLOCATE(grid%apr_st,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7235,& 'frame/module_domain.f: Failed to deallocate grid%apr_st. ') endif ENDIF IF ( ASSOCIATED( grid%apr_as ) ) THEN DEALLOCATE(grid%apr_as,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7242,& 'frame/module_domain.f: Failed to deallocate grid%apr_as. ') endif ENDIF IF ( ASSOCIATED( grid%apr_capma ) ) THEN DEALLOCATE(grid%apr_capma,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7249,& 'frame/module_domain.f: Failed to deallocate grid%apr_capma. ') endif ENDIF IF ( ASSOCIATED( grid%apr_capme ) ) THEN DEALLOCATE(grid%apr_capme,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7256,& 'frame/module_domain.f: Failed to deallocate grid%apr_capme. ') endif ENDIF IF ( ASSOCIATED( grid%apr_capmi ) ) THEN DEALLOCATE(grid%apr_capmi,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7263,& 'frame/module_domain.f: Failed to deallocate grid%apr_capmi. ') endif ENDIF IF ( ASSOCIATED( grid%xf_ens ) ) THEN DEALLOCATE(grid%xf_ens,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7270,& 'frame/module_domain.f: Failed to deallocate grid%xf_ens. ') endif ENDIF IF ( ASSOCIATED( grid%pr_ens ) ) THEN DEALLOCATE(grid%pr_ens,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7277,& 'frame/module_domain.f: Failed to deallocate grid%pr_ens. ') endif ENDIF IF ( ASSOCIATED( grid%udr_kf ) ) THEN DEALLOCATE(grid%udr_kf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7284,& 'frame/module_domain.f: Failed to deallocate grid%udr_kf. ') endif ENDIF IF ( ASSOCIATED( grid%ddr_kf ) ) THEN DEALLOCATE(grid%ddr_kf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7291,& 'frame/module_domain.f: Failed to deallocate grid%ddr_kf. ') endif ENDIF IF ( ASSOCIATED( grid%uer_kf ) ) THEN DEALLOCATE(grid%uer_kf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7298,& 'frame/module_domain.f: Failed to deallocate grid%uer_kf. ') endif ENDIF IF ( ASSOCIATED( grid%der_kf ) ) THEN DEALLOCATE(grid%der_kf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7305,& 'frame/module_domain.f: Failed to deallocate grid%der_kf. ') endif ENDIF IF ( ASSOCIATED( grid%timec_kf ) ) THEN DEALLOCATE(grid%timec_kf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7312,& 'frame/module_domain.f: Failed to deallocate grid%timec_kf. ') endif ENDIF IF ( ASSOCIATED( grid%rthften ) ) THEN DEALLOCATE(grid%rthften,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7319,& 'frame/module_domain.f: Failed to deallocate grid%rthften. ') endif ENDIF IF ( ASSOCIATED( grid%rqvften ) ) THEN DEALLOCATE(grid%rqvften,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7326,& 'frame/module_domain.f: Failed to deallocate grid%rqvften. ') endif ENDIF IF ( ASSOCIATED( grid%snowh ) ) THEN DEALLOCATE(grid%snowh,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7333,& 'frame/module_domain.f: Failed to deallocate grid%snowh. ') endif ENDIF IF ( ASSOCIATED( grid%rhosn ) ) THEN DEALLOCATE(grid%rhosn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7340,& 'frame/module_domain.f: Failed to deallocate grid%rhosn. ') endif ENDIF IF ( ASSOCIATED( grid%smfr3d ) ) THEN DEALLOCATE(grid%smfr3d,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7347,& 'frame/module_domain.f: Failed to deallocate grid%smfr3d. ') endif ENDIF IF ( ASSOCIATED( grid%keepfr3dflag ) ) THEN DEALLOCATE(grid%keepfr3dflag,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7354,& 'frame/module_domain.f: Failed to deallocate grid%keepfr3dflag. ') endif ENDIF IF ( ASSOCIATED( grid%rhosnf ) ) THEN DEALLOCATE(grid%rhosnf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7361,& 'frame/module_domain.f: Failed to deallocate grid%rhosnf. ') endif ENDIF IF ( ASSOCIATED( grid%snowfallac ) ) THEN DEALLOCATE(grid%snowfallac,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7368,& 'frame/module_domain.f: Failed to deallocate grid%snowfallac. ') endif ENDIF IF ( ASSOCIATED( grid%precipfr ) ) THEN DEALLOCATE(grid%precipfr,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7375,& 'frame/module_domain.f: Failed to deallocate grid%precipfr. ') endif ENDIF IF ( ASSOCIATED( grid%rc_mf ) ) THEN DEALLOCATE(grid%rc_mf,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7382,& 'frame/module_domain.f: Failed to deallocate grid%rc_mf. ') endif ENDIF IF ( ASSOCIATED( grid%flx4 ) ) THEN DEALLOCATE(grid%flx4,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7389,& 'frame/module_domain.f: Failed to deallocate grid%flx4. ') endif ENDIF IF ( ASSOCIATED( grid%fvb ) ) THEN DEALLOCATE(grid%fvb,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7396,& 'frame/module_domain.f: Failed to deallocate grid%fvb. ') endif ENDIF IF ( ASSOCIATED( grid%fbur ) ) THEN DEALLOCATE(grid%fbur,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7403,& 'frame/module_domain.f: Failed to deallocate grid%fbur. ') endif ENDIF IF ( ASSOCIATED( grid%fgsn ) ) THEN DEALLOCATE(grid%fgsn,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7410,& 'frame/module_domain.f: Failed to deallocate grid%fgsn. ') endif ENDIF IF ( ASSOCIATED( grid%isnowxy ) ) THEN DEALLOCATE(grid%isnowxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7417,& 'frame/module_domain.f: Failed to deallocate grid%isnowxy. ') endif ENDIF IF ( ASSOCIATED( grid%tvxy ) ) THEN DEALLOCATE(grid%tvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7424,& 'frame/module_domain.f: Failed to deallocate grid%tvxy. ') endif ENDIF IF ( ASSOCIATED( grid%tgxy ) ) THEN DEALLOCATE(grid%tgxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7431,& 'frame/module_domain.f: Failed to deallocate grid%tgxy. ') endif ENDIF IF ( ASSOCIATED( grid%canicexy ) ) THEN DEALLOCATE(grid%canicexy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7438,& 'frame/module_domain.f: Failed to deallocate grid%canicexy. ') endif ENDIF IF ( ASSOCIATED( grid%canliqxy ) ) THEN DEALLOCATE(grid%canliqxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7445,& 'frame/module_domain.f: Failed to deallocate grid%canliqxy. ') endif ENDIF IF ( ASSOCIATED( grid%eahxy ) ) THEN DEALLOCATE(grid%eahxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7452,& 'frame/module_domain.f: Failed to deallocate grid%eahxy. ') endif ENDIF IF ( ASSOCIATED( grid%tahxy ) ) THEN DEALLOCATE(grid%tahxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7459,& 'frame/module_domain.f: Failed to deallocate grid%tahxy. ') endif ENDIF IF ( ASSOCIATED( grid%cmxy ) ) THEN DEALLOCATE(grid%cmxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7466,& 'frame/module_domain.f: Failed to deallocate grid%cmxy. ') endif ENDIF IF ( ASSOCIATED( grid%chxy ) ) THEN DEALLOCATE(grid%chxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7473,& 'frame/module_domain.f: Failed to deallocate grid%chxy. ') endif ENDIF IF ( ASSOCIATED( grid%fwetxy ) ) THEN DEALLOCATE(grid%fwetxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7480,& 'frame/module_domain.f: Failed to deallocate grid%fwetxy. ') endif ENDIF IF ( ASSOCIATED( grid%sneqvoxy ) ) THEN DEALLOCATE(grid%sneqvoxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7487,& 'frame/module_domain.f: Failed to deallocate grid%sneqvoxy. ') endif ENDIF IF ( ASSOCIATED( grid%alboldxy ) ) THEN DEALLOCATE(grid%alboldxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7494,& 'frame/module_domain.f: Failed to deallocate grid%alboldxy. ') endif ENDIF IF ( ASSOCIATED( grid%qsnowxy ) ) THEN DEALLOCATE(grid%qsnowxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7501,& 'frame/module_domain.f: Failed to deallocate grid%qsnowxy. ') endif ENDIF IF ( ASSOCIATED( grid%wslakexy ) ) THEN DEALLOCATE(grid%wslakexy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7508,& 'frame/module_domain.f: Failed to deallocate grid%wslakexy. ') endif ENDIF IF ( ASSOCIATED( grid%zwtxy ) ) THEN DEALLOCATE(grid%zwtxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7515,& 'frame/module_domain.f: Failed to deallocate grid%zwtxy. ') endif ENDIF IF ( ASSOCIATED( grid%waxy ) ) THEN DEALLOCATE(grid%waxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7522,& 'frame/module_domain.f: Failed to deallocate grid%waxy. ') endif ENDIF IF ( ASSOCIATED( grid%wtxy ) ) THEN DEALLOCATE(grid%wtxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7529,& 'frame/module_domain.f: Failed to deallocate grid%wtxy. ') endif ENDIF IF ( ASSOCIATED( grid%tsnoxy ) ) THEN DEALLOCATE(grid%tsnoxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7536,& 'frame/module_domain.f: Failed to deallocate grid%tsnoxy. ') endif ENDIF IF ( ASSOCIATED( grid%zsnsoxy ) ) THEN DEALLOCATE(grid%zsnsoxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7543,& 'frame/module_domain.f: Failed to deallocate grid%zsnsoxy. ') endif ENDIF IF ( ASSOCIATED( grid%snicexy ) ) THEN DEALLOCATE(grid%snicexy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7550,& 'frame/module_domain.f: Failed to deallocate grid%snicexy. ') endif ENDIF IF ( ASSOCIATED( grid%snliqxy ) ) THEN DEALLOCATE(grid%snliqxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7557,& 'frame/module_domain.f: Failed to deallocate grid%snliqxy. ') endif ENDIF IF ( ASSOCIATED( grid%lfmassxy ) ) THEN DEALLOCATE(grid%lfmassxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7564,& 'frame/module_domain.f: Failed to deallocate grid%lfmassxy. ') endif ENDIF IF ( ASSOCIATED( grid%rtmassxy ) ) THEN DEALLOCATE(grid%rtmassxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7571,& 'frame/module_domain.f: Failed to deallocate grid%rtmassxy. ') endif ENDIF IF ( ASSOCIATED( grid%stmassxy ) ) THEN DEALLOCATE(grid%stmassxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7578,& 'frame/module_domain.f: Failed to deallocate grid%stmassxy. ') endif ENDIF IF ( ASSOCIATED( grid%woodxy ) ) THEN DEALLOCATE(grid%woodxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7585,& 'frame/module_domain.f: Failed to deallocate grid%woodxy. ') endif ENDIF IF ( ASSOCIATED( grid%stblcpxy ) ) THEN DEALLOCATE(grid%stblcpxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7592,& 'frame/module_domain.f: Failed to deallocate grid%stblcpxy. ') endif ENDIF IF ( ASSOCIATED( grid%fastcpxy ) ) THEN DEALLOCATE(grid%fastcpxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7599,& 'frame/module_domain.f: Failed to deallocate grid%fastcpxy. ') endif ENDIF IF ( ASSOCIATED( grid%xsaixy ) ) THEN DEALLOCATE(grid%xsaixy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7606,& 'frame/module_domain.f: Failed to deallocate grid%xsaixy. ') endif ENDIF IF ( ASSOCIATED( grid%taussxy ) ) THEN DEALLOCATE(grid%taussxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7613,& 'frame/module_domain.f: Failed to deallocate grid%taussxy. ') endif ENDIF IF ( ASSOCIATED( grid%t2mvxy ) ) THEN DEALLOCATE(grid%t2mvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7620,& 'frame/module_domain.f: Failed to deallocate grid%t2mvxy. ') endif ENDIF IF ( ASSOCIATED( grid%t2mbxy ) ) THEN DEALLOCATE(grid%t2mbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7627,& 'frame/module_domain.f: Failed to deallocate grid%t2mbxy. ') endif ENDIF IF ( ASSOCIATED( grid%q2mvxy ) ) THEN DEALLOCATE(grid%q2mvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7634,& 'frame/module_domain.f: Failed to deallocate grid%q2mvxy. ') endif ENDIF IF ( ASSOCIATED( grid%q2mbxy ) ) THEN DEALLOCATE(grid%q2mbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7641,& 'frame/module_domain.f: Failed to deallocate grid%q2mbxy. ') endif ENDIF IF ( ASSOCIATED( grid%tradxy ) ) THEN DEALLOCATE(grid%tradxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7648,& 'frame/module_domain.f: Failed to deallocate grid%tradxy. ') endif ENDIF IF ( ASSOCIATED( grid%neexy ) ) THEN DEALLOCATE(grid%neexy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7655,& 'frame/module_domain.f: Failed to deallocate grid%neexy. ') endif ENDIF IF ( ASSOCIATED( grid%gppxy ) ) THEN DEALLOCATE(grid%gppxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7662,& 'frame/module_domain.f: Failed to deallocate grid%gppxy. ') endif ENDIF IF ( ASSOCIATED( grid%nppxy ) ) THEN DEALLOCATE(grid%nppxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7669,& 'frame/module_domain.f: Failed to deallocate grid%nppxy. ') endif ENDIF IF ( ASSOCIATED( grid%fvegxy ) ) THEN DEALLOCATE(grid%fvegxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7676,& 'frame/module_domain.f: Failed to deallocate grid%fvegxy. ') endif ENDIF IF ( ASSOCIATED( grid%qinxy ) ) THEN DEALLOCATE(grid%qinxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7683,& 'frame/module_domain.f: Failed to deallocate grid%qinxy. ') endif ENDIF IF ( ASSOCIATED( grid%runsfxy ) ) THEN DEALLOCATE(grid%runsfxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7690,& 'frame/module_domain.f: Failed to deallocate grid%runsfxy. ') endif ENDIF IF ( ASSOCIATED( grid%runsbxy ) ) THEN DEALLOCATE(grid%runsbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7697,& 'frame/module_domain.f: Failed to deallocate grid%runsbxy. ') endif ENDIF IF ( ASSOCIATED( grid%ecanxy ) ) THEN DEALLOCATE(grid%ecanxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7704,& 'frame/module_domain.f: Failed to deallocate grid%ecanxy. ') endif ENDIF IF ( ASSOCIATED( grid%edirxy ) ) THEN DEALLOCATE(grid%edirxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7711,& 'frame/module_domain.f: Failed to deallocate grid%edirxy. ') endif ENDIF IF ( ASSOCIATED( grid%etranxy ) ) THEN DEALLOCATE(grid%etranxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7718,& 'frame/module_domain.f: Failed to deallocate grid%etranxy. ') endif ENDIF IF ( ASSOCIATED( grid%fsaxy ) ) THEN DEALLOCATE(grid%fsaxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7725,& 'frame/module_domain.f: Failed to deallocate grid%fsaxy. ') endif ENDIF IF ( ASSOCIATED( grid%firaxy ) ) THEN DEALLOCATE(grid%firaxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7732,& 'frame/module_domain.f: Failed to deallocate grid%firaxy. ') endif ENDIF IF ( ASSOCIATED( grid%aparxy ) ) THEN DEALLOCATE(grid%aparxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7739,& 'frame/module_domain.f: Failed to deallocate grid%aparxy. ') endif ENDIF IF ( ASSOCIATED( grid%psnxy ) ) THEN DEALLOCATE(grid%psnxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7746,& 'frame/module_domain.f: Failed to deallocate grid%psnxy. ') endif ENDIF IF ( ASSOCIATED( grid%savxy ) ) THEN DEALLOCATE(grid%savxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7753,& 'frame/module_domain.f: Failed to deallocate grid%savxy. ') endif ENDIF IF ( ASSOCIATED( grid%sagxy ) ) THEN DEALLOCATE(grid%sagxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7760,& 'frame/module_domain.f: Failed to deallocate grid%sagxy. ') endif ENDIF IF ( ASSOCIATED( grid%rssunxy ) ) THEN DEALLOCATE(grid%rssunxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7767,& 'frame/module_domain.f: Failed to deallocate grid%rssunxy. ') endif ENDIF IF ( ASSOCIATED( grid%rsshaxy ) ) THEN DEALLOCATE(grid%rsshaxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7774,& 'frame/module_domain.f: Failed to deallocate grid%rsshaxy. ') endif ENDIF IF ( ASSOCIATED( grid%bgapxy ) ) THEN DEALLOCATE(grid%bgapxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7781,& 'frame/module_domain.f: Failed to deallocate grid%bgapxy. ') endif ENDIF IF ( ASSOCIATED( grid%wgapxy ) ) THEN DEALLOCATE(grid%wgapxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7788,& 'frame/module_domain.f: Failed to deallocate grid%wgapxy. ') endif ENDIF IF ( ASSOCIATED( grid%tgvxy ) ) THEN DEALLOCATE(grid%tgvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7795,& 'frame/module_domain.f: Failed to deallocate grid%tgvxy. ') endif ENDIF IF ( ASSOCIATED( grid%tgbxy ) ) THEN DEALLOCATE(grid%tgbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7802,& 'frame/module_domain.f: Failed to deallocate grid%tgbxy. ') endif ENDIF IF ( ASSOCIATED( grid%chvxy ) ) THEN DEALLOCATE(grid%chvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7809,& 'frame/module_domain.f: Failed to deallocate grid%chvxy. ') endif ENDIF IF ( ASSOCIATED( grid%chbxy ) ) THEN DEALLOCATE(grid%chbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7816,& 'frame/module_domain.f: Failed to deallocate grid%chbxy. ') endif ENDIF IF ( ASSOCIATED( grid%shgxy ) ) THEN DEALLOCATE(grid%shgxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7823,& 'frame/module_domain.f: Failed to deallocate grid%shgxy. ') endif ENDIF IF ( ASSOCIATED( grid%shcxy ) ) THEN DEALLOCATE(grid%shcxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7830,& 'frame/module_domain.f: Failed to deallocate grid%shcxy. ') endif ENDIF IF ( ASSOCIATED( grid%shbxy ) ) THEN DEALLOCATE(grid%shbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7837,& 'frame/module_domain.f: Failed to deallocate grid%shbxy. ') endif ENDIF IF ( ASSOCIATED( grid%evgxy ) ) THEN DEALLOCATE(grid%evgxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7844,& 'frame/module_domain.f: Failed to deallocate grid%evgxy. ') endif ENDIF IF ( ASSOCIATED( grid%evbxy ) ) THEN DEALLOCATE(grid%evbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7851,& 'frame/module_domain.f: Failed to deallocate grid%evbxy. ') endif ENDIF IF ( ASSOCIATED( grid%ghvxy ) ) THEN DEALLOCATE(grid%ghvxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7858,& 'frame/module_domain.f: Failed to deallocate grid%ghvxy. ') endif ENDIF IF ( ASSOCIATED( grid%ghbxy ) ) THEN DEALLOCATE(grid%ghbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7865,& 'frame/module_domain.f: Failed to deallocate grid%ghbxy. ') endif ENDIF IF ( ASSOCIATED( grid%irgxy ) ) THEN DEALLOCATE(grid%irgxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7872,& 'frame/module_domain.f: Failed to deallocate grid%irgxy. ') endif ENDIF IF ( ASSOCIATED( grid%ircxy ) ) THEN DEALLOCATE(grid%ircxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7879,& 'frame/module_domain.f: Failed to deallocate grid%ircxy. ') endif ENDIF IF ( ASSOCIATED( grid%irbxy ) ) THEN DEALLOCATE(grid%irbxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7886,& 'frame/module_domain.f: Failed to deallocate grid%irbxy. ') endif ENDIF IF ( ASSOCIATED( grid%trxy ) ) THEN DEALLOCATE(grid%trxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7893,& 'frame/module_domain.f: Failed to deallocate grid%trxy. ') endif ENDIF IF ( ASSOCIATED( grid%evcxy ) ) THEN DEALLOCATE(grid%evcxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7900,& 'frame/module_domain.f: Failed to deallocate grid%evcxy. ') endif ENDIF IF ( ASSOCIATED( grid%chleafxy ) ) THEN DEALLOCATE(grid%chleafxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7907,& 'frame/module_domain.f: Failed to deallocate grid%chleafxy. ') endif ENDIF IF ( ASSOCIATED( grid%chucxy ) ) THEN DEALLOCATE(grid%chucxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7914,& 'frame/module_domain.f: Failed to deallocate grid%chucxy. ') endif ENDIF IF ( ASSOCIATED( grid%chv2xy ) ) THEN DEALLOCATE(grid%chv2xy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7921,& 'frame/module_domain.f: Failed to deallocate grid%chv2xy. ') endif ENDIF IF ( ASSOCIATED( grid%chb2xy ) ) THEN DEALLOCATE(grid%chb2xy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7928,& 'frame/module_domain.f: Failed to deallocate grid%chb2xy. ') endif ENDIF IF ( ASSOCIATED( grid%chstarxy ) ) THEN DEALLOCATE(grid%chstarxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7935,& 'frame/module_domain.f: Failed to deallocate grid%chstarxy. ') endif ENDIF IF ( ASSOCIATED( grid%smoiseq ) ) THEN DEALLOCATE(grid%smoiseq,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7942,& 'frame/module_domain.f: Failed to deallocate grid%smoiseq. ') endif ENDIF IF ( ASSOCIATED( grid%smcwtdxy ) ) THEN DEALLOCATE(grid%smcwtdxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7949,& 'frame/module_domain.f: Failed to deallocate grid%smcwtdxy. ') endif ENDIF IF ( ASSOCIATED( grid%rechxy ) ) THEN DEALLOCATE(grid%rechxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7956,& 'frame/module_domain.f: Failed to deallocate grid%rechxy. ') endif ENDIF IF ( ASSOCIATED( grid%deeprechxy ) ) THEN DEALLOCATE(grid%deeprechxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7963,& 'frame/module_domain.f: Failed to deallocate grid%deeprechxy. ') endif ENDIF IF ( ASSOCIATED( grid%grainxy ) ) THEN DEALLOCATE(grid%grainxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7970,& 'frame/module_domain.f: Failed to deallocate grid%grainxy. ') endif ENDIF IF ( ASSOCIATED( grid%gddxy ) ) THEN DEALLOCATE(grid%gddxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7977,& 'frame/module_domain.f: Failed to deallocate grid%gddxy. ') endif ENDIF IF ( ASSOCIATED( grid%croptype ) ) THEN DEALLOCATE(grid%croptype,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7984,& 'frame/module_domain.f: Failed to deallocate grid%croptype. ') endif ENDIF IF ( ASSOCIATED( grid%planting ) ) THEN DEALLOCATE(grid%planting,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7991,& 'frame/module_domain.f: Failed to deallocate grid%planting. ') endif ENDIF IF ( ASSOCIATED( grid%harvest ) ) THEN DEALLOCATE(grid%harvest,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",7998,& 'frame/module_domain.f: Failed to deallocate grid%harvest. ') endif ENDIF IF ( ASSOCIATED( grid%season_gdd ) ) THEN DEALLOCATE(grid%season_gdd,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8005,& 'frame/module_domain.f: Failed to deallocate grid%season_gdd. ') endif ENDIF IF ( ASSOCIATED( grid%cropcat ) ) THEN DEALLOCATE(grid%cropcat,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8012,& 'frame/module_domain.f: Failed to deallocate grid%cropcat. ') endif ENDIF IF ( ASSOCIATED( grid%pgsxy ) ) THEN DEALLOCATE(grid%pgsxy,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8019,& 'frame/module_domain.f: Failed to deallocate grid%pgsxy. ') endif ENDIF IF ( ASSOCIATED( grid%mp_restart_state ) ) THEN DEALLOCATE(grid%mp_restart_state,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8026,& 'frame/module_domain.f: Failed to deallocate grid%mp_restart_state. ') endif ENDIF IF ( ASSOCIATED( grid%tbpvs_state ) ) THEN DEALLOCATE(grid%tbpvs_state,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8033,& 'frame/module_domain.f: Failed to deallocate grid%tbpvs_state. ') endif ENDIF IF ( ASSOCIATED( grid%tbpvs0_state ) ) THEN DEALLOCATE(grid%tbpvs0_state,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8040,& 'frame/module_domain.f: Failed to deallocate grid%tbpvs0_state. ') endif ENDIF IF ( ASSOCIATED( grid%lu_state ) ) THEN DEALLOCATE(grid%lu_state,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8047,& 'frame/module_domain.f: Failed to deallocate grid%lu_state. ') endif ENDIF IF ( ASSOCIATED( grid%power ) ) THEN DEALLOCATE(grid%power,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8054,& 'frame/module_domain.f: Failed to deallocate grid%power. ') endif ENDIF IF ( ASSOCIATED( grid%ozmixm ) ) THEN DEALLOCATE(grid%ozmixm,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8061,& 'frame/module_domain.f: Failed to deallocate grid%ozmixm. ') endif ENDIF IF ( ASSOCIATED( grid%pin ) ) THEN DEALLOCATE(grid%pin,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8068,& 'frame/module_domain.f: Failed to deallocate grid%pin. ') endif ENDIF IF ( ASSOCIATED( grid%o3rad ) ) THEN DEALLOCATE(grid%o3rad,STAT=ierr) if (ierr.ne.0) then CALL wrf_error_fatal3("",8075,& 'frame/module_domain.f: Failed to deallocate grid%o3rad. ') endif ENDIF END SUBROUTINE dealloc_space_field RECURSIVE SUBROUTINE find_grid_by_id ( id, in_grid, result_grid ) IMPLICIT NONE INTEGER, INTENT(IN) :: id TYPE(domain), POINTER :: in_grid TYPE(domain), POINTER :: result_grid TYPE(domain), POINTER :: grid_ptr INTEGER :: kid LOGICAL :: found found = .FALSE. NULLIFY(result_grid) IF ( ASSOCIATED( in_grid ) ) THEN IF ( in_grid%id .EQ. id ) THEN result_grid => in_grid ELSE grid_ptr => in_grid DO WHILE ( ASSOCIATED( grid_ptr ) .AND. .NOT. found ) DO kid = 1, max_nests IF ( ASSOCIATED( grid_ptr%nests(kid)%ptr ) .AND. .NOT. found ) THEN CALL find_grid_by_id ( id, grid_ptr%nests(kid)%ptr, result_grid ) IF ( ASSOCIATED( result_grid ) ) THEN IF ( result_grid%id .EQ. id ) found = .TRUE. ENDIF ENDIF ENDDO IF ( .NOT. found ) grid_ptr => grid_ptr%sibling ENDDO ENDIF ENDIF RETURN END SUBROUTINE find_grid_by_id FUNCTION first_loc_integer ( array , search ) RESULT ( loc ) IMPLICIT NONE INTEGER , INTENT(IN) , DIMENSION(:) :: array INTEGER , INTENT(IN) :: search INTEGER :: loc INTEGER :: loop loc = -1 find : DO loop = 1 , SIZE(array) IF ( search == array(loop) ) THEN loc = loop EXIT find END IF END DO find END FUNCTION first_loc_integer SUBROUTINE init_module_domain END SUBROUTINE init_module_domain FUNCTION domain_get_current_time ( grid ) RESULT ( current_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_Time) :: current_time INTEGER :: rc CALL WRFU_ClockGet( grid%domain_clock, CurrTime=current_time, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8182,& 'domain_get_current_time: WRFU_ClockGet failed' ) ENDIF END FUNCTION domain_get_current_time FUNCTION domain_get_start_time ( grid ) RESULT ( start_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_Time) :: start_time INTEGER :: rc CALL WRFU_ClockGet( grid%domain_clock, StartTime=start_time, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8202,& 'domain_get_start_time: WRFU_ClockGet failed' ) ENDIF END FUNCTION domain_get_start_time FUNCTION domain_get_stop_time ( grid ) RESULT ( stop_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_Time) :: stop_time INTEGER :: rc CALL WRFU_ClockGet( grid%domain_clock, StopTime=stop_time, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8222,& 'domain_get_stop_time: WRFU_ClockGet failed' ) ENDIF END FUNCTION domain_get_stop_time FUNCTION domain_get_time_step ( grid ) RESULT ( time_step ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_TimeInterval) :: time_step INTEGER :: rc CALL WRFU_ClockGet( grid%domain_clock, timeStep=time_step, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8242,& 'domain_get_time_step: WRFU_ClockGet failed' ) ENDIF END FUNCTION domain_get_time_step FUNCTION domain_get_advanceCount ( grid ) RESULT ( advanceCount ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid INTEGER :: advanceCount INTEGER(WRFU_KIND_I8) :: advanceCountLcl INTEGER :: rc CALL WRFU_ClockGet( grid%domain_clock, & advanceCount=advanceCountLcl, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8265,& 'domain_get_advanceCount: WRFU_ClockGet failed' ) ENDIF advanceCount = advanceCountLcl END FUNCTION domain_get_advanceCount SUBROUTINE domain_alarms_destroy ( grid ) IMPLICIT NONE TYPE(domain), INTENT(INOUT) :: grid INTEGER :: alarmid IF ( ASSOCIATED( grid%alarms ) .AND. & ASSOCIATED( grid%alarms_created ) ) THEN DO alarmid = 1, MAX_WRF_ALARMS IF ( grid%alarms_created( alarmid ) ) THEN CALL WRFU_AlarmDestroy( grid%alarms( alarmid ) ) grid%alarms_created( alarmid ) = .FALSE. ENDIF ENDDO DEALLOCATE( grid%alarms ) NULLIFY( grid%alarms ) DEALLOCATE( grid%alarms_created ) NULLIFY( grid%alarms_created ) ENDIF END SUBROUTINE domain_alarms_destroy SUBROUTINE domain_clock_destroy ( grid ) IMPLICIT NONE TYPE(domain), INTENT(INOUT) :: grid IF ( ASSOCIATED( grid%domain_clock ) ) THEN IF ( grid%domain_clock_created ) THEN CALL WRFU_ClockDestroy( grid%domain_clock ) grid%domain_clock_created = .FALSE. ENDIF DEALLOCATE( grid%domain_clock ) NULLIFY( grid%domain_clock ) ENDIF END SUBROUTINE domain_clock_destroy FUNCTION domain_last_time_step ( grid ) RESULT ( LAST_TIME ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid LOGICAL :: LAST_TIME LAST_TIME = domain_get_stop_time( grid ) .EQ. & ( domain_get_current_time( grid ) + & domain_get_time_step( grid ) ) END FUNCTION domain_last_time_step FUNCTION domain_clockisstoptime ( grid ) RESULT ( is_stop_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid LOGICAL :: is_stop_time INTEGER :: rc is_stop_time = WRFU_ClockIsStopTime( grid%domain_clock , rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8347,& 'domain_clockisstoptime: WRFU_ClockIsStopTime() failed' ) ENDIF END FUNCTION domain_clockisstoptime FUNCTION domain_clockisstopsubtime ( grid ) RESULT ( is_stop_subtime ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid LOGICAL :: is_stop_subtime INTEGER :: rc TYPE(WRFU_TimeInterval) :: timeStep TYPE(WRFU_Time) :: currentTime LOGICAL :: positive_timestep is_stop_subtime = .FALSE. CALL domain_clock_get( grid, time_step=timeStep, & current_time=currentTime ) positive_timestep = ESMF_TimeIntervalIsPositive( timeStep ) IF ( positive_timestep ) THEN IF ( ESMF_TimeGE( currentTime, grid%stop_subtime ) ) THEN is_stop_subtime = .TRUE. ENDIF ELSE IF ( ESMF_TimeLE( currentTime, grid%stop_subtime ) ) THEN is_stop_subtime = .TRUE. ENDIF ENDIF END FUNCTION domain_clockisstopsubtime FUNCTION domain_get_sim_start_time ( grid ) RESULT ( simulationStartTime ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_Time) :: simulationStartTime INTEGER :: rc INTEGER :: simulation_start_year, simulation_start_month, & simulation_start_day, simulation_start_hour , & simulation_start_minute, simulation_start_second CALL nl_get_simulation_start_year ( 1, simulation_start_year ) CALL nl_get_simulation_start_month ( 1, simulation_start_month ) CALL nl_get_simulation_start_day ( 1, simulation_start_day ) CALL nl_get_simulation_start_hour ( 1, simulation_start_hour ) CALL nl_get_simulation_start_minute ( 1, simulation_start_minute ) CALL nl_get_simulation_start_second ( 1, simulation_start_second ) CALL WRFU_TimeSet( simulationStartTime, & YY=simulation_start_year, & MM=simulation_start_month, & DD=simulation_start_day, & H=simulation_start_hour, & M=simulation_start_minute, & S=simulation_start_second, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL nl_get_start_year ( 1, simulation_start_year ) CALL nl_get_start_month ( 1, simulation_start_month ) CALL nl_get_start_day ( 1, simulation_start_day ) CALL nl_get_start_hour ( 1, simulation_start_hour ) CALL nl_get_start_minute ( 1, simulation_start_minute ) CALL nl_get_start_second ( 1, simulation_start_second ) CALL wrf_debug( 150, "WARNING: domain_get_sim_start_time using head_grid start time from namelist" ) CALL WRFU_TimeSet( simulationStartTime, & YY=simulation_start_year, & MM=simulation_start_month, & DD=simulation_start_day, & H=simulation_start_hour, & M=simulation_start_minute, & S=simulation_start_second, & rc=rc ) ENDIF RETURN END FUNCTION domain_get_sim_start_time FUNCTION domain_get_time_since_sim_start ( grid ) RESULT ( time_since_sim_start ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_TimeInterval) :: time_since_sim_start TYPE(WRFU_Time) :: lcl_currtime, lcl_simstarttime lcl_simstarttime = domain_get_sim_start_time( grid ) lcl_currtime = domain_get_current_time ( grid ) time_since_sim_start = lcl_currtime - lcl_simstarttime END FUNCTION domain_get_time_since_sim_start SUBROUTINE domain_clock_get( grid, current_time, & current_timestr, & current_timestr_frac, & start_time, start_timestr, & stop_time, stop_timestr, & time_step, time_stepstr, & time_stepstr_frac, & advanceCount, & currentDayOfYearReal, & minutesSinceSimulationStart, & timeSinceSimulationStart, & simulationStartTime, & simulationStartTimeStr ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid TYPE(WRFU_Time), INTENT( OUT), OPTIONAL :: current_time CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: current_timestr CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: current_timestr_frac TYPE(WRFU_Time), INTENT( OUT), OPTIONAL :: start_time CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: start_timestr TYPE(WRFU_Time), INTENT( OUT), OPTIONAL :: stop_time CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: stop_timestr TYPE(WRFU_TimeInterval), INTENT( OUT), OPTIONAL :: time_step CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: time_stepstr CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: time_stepstr_frac INTEGER, INTENT( OUT), OPTIONAL :: advanceCount REAL, INTENT( OUT), OPTIONAL :: currentDayOfYearReal TYPE(WRFU_Time), INTENT( OUT), OPTIONAL :: simulationStartTime CHARACTER (LEN=*), INTENT( OUT), OPTIONAL :: simulationStartTimeStr TYPE(WRFU_TimeInterval), INTENT( OUT), OPTIONAL :: timeSinceSimulationStart REAL, INTENT( OUT), OPTIONAL :: minutesSinceSimulationStart TYPE(WRFU_Time) :: lcl_currtime, lcl_stoptime, lcl_starttime TYPE(WRFU_Time) :: lcl_simulationStartTime TYPE(WRFU_TimeInterval) :: lcl_time_step, lcl_timeSinceSimulationStart INTEGER :: days, seconds, Sn, Sd, rc CHARACTER (LEN=256) :: tmp_str CHARACTER (LEN=256) :: frac_str REAL(WRFU_KIND_R8) :: currentDayOfYearR8 IF ( PRESENT( start_time ) ) THEN start_time = domain_get_start_time ( grid ) ENDIF IF ( PRESENT( start_timestr ) ) THEN lcl_starttime = domain_get_start_time ( grid ) CALL wrf_timetoa ( lcl_starttime, start_timestr ) ENDIF IF ( PRESENT( time_step ) ) THEN time_step = domain_get_time_step ( grid ) ENDIF IF ( PRESENT( time_stepstr ) ) THEN lcl_time_step = domain_get_time_step ( grid ) CALL WRFU_TimeIntervalGet( lcl_time_step, & timeString=time_stepstr, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8537,& 'domain_clock_get: WRFU_TimeIntervalGet() failed' ) ENDIF ENDIF IF ( PRESENT( time_stepstr_frac ) ) THEN lcl_time_step = domain_get_time_step ( grid ) CALL WRFU_TimeIntervalGet( lcl_time_step, timeString=tmp_str, & Sn=Sn, Sd=Sd, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8546,& 'domain_clock_get: WRFU_TimeIntervalGet() failed' ) ENDIF CALL fraction_to_string( Sn, Sd, frac_str ) time_stepstr_frac = TRIM(tmp_str)//TRIM(frac_str) ENDIF IF ( PRESENT( advanceCount ) ) THEN advanceCount = domain_get_advanceCount ( grid ) ENDIF IF ( PRESENT( current_time ) ) THEN current_time = domain_get_current_time ( grid ) ENDIF IF ( PRESENT( current_timestr ) ) THEN lcl_currtime = domain_get_current_time ( grid ) CALL wrf_timetoa ( lcl_currtime, current_timestr ) ENDIF IF ( PRESENT( current_timestr_frac ) ) THEN lcl_currtime = domain_get_current_time ( grid ) CALL wrf_timetoa ( lcl_currtime, tmp_str ) CALL WRFU_TimeGet( lcl_currtime, Sn=Sn, Sd=Sd, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8574,& 'domain_clock_get: WRFU_TimeGet() failed' ) ENDIF CALL fraction_to_string( Sn, Sd, frac_str ) current_timestr_frac = TRIM(tmp_str)//TRIM(frac_str) ENDIF IF ( PRESENT( stop_time ) ) THEN stop_time = domain_get_stop_time ( grid ) ENDIF IF ( PRESENT( stop_timestr ) ) THEN lcl_stoptime = domain_get_stop_time ( grid ) CALL wrf_timetoa ( lcl_stoptime, stop_timestr ) ENDIF IF ( PRESENT( currentDayOfYearReal ) ) THEN lcl_currtime = domain_get_current_time ( grid ) CALL WRFU_TimeGet( lcl_currtime, dayOfYear_r8=currentDayOfYearR8, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8592,& 'domain_clock_get: WRFU_TimeGet(dayOfYear_r8) failed' ) ENDIF currentDayOfYearReal = REAL( currentDayOfYearR8 ) - 1.0 ENDIF IF ( PRESENT( simulationStartTime ) ) THEN simulationStartTime = domain_get_sim_start_time( grid ) ENDIF IF ( PRESENT( simulationStartTimeStr ) ) THEN lcl_simulationStartTime = domain_get_sim_start_time( grid ) CALL wrf_timetoa ( lcl_simulationStartTime, simulationStartTimeStr ) ENDIF IF ( PRESENT( timeSinceSimulationStart ) ) THEN timeSinceSimulationStart = domain_get_time_since_sim_start( grid ) ENDIF IF ( PRESENT( minutesSinceSimulationStart ) ) THEN lcl_timeSinceSimulationStart = domain_get_time_since_sim_start( grid ) CALL WRFU_TimeIntervalGet( lcl_timeSinceSimulationStart, & D=days, S=seconds, Sn=Sn, Sd=Sd, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8612,& 'domain_clock_get: WRFU_TimeIntervalGet() failed' ) ENDIF minutesSinceSimulationStart = ( REAL( days ) * 24. * 60. ) + & ( REAL( seconds ) / 60. ) IF ( Sd /= 0 ) THEN minutesSinceSimulationStart = minutesSinceSimulationStart + & ( ( REAL( Sn ) / REAL( Sd ) ) / 60. ) ENDIF ENDIF RETURN END SUBROUTINE domain_clock_get FUNCTION domain_clockisstarttime ( grid ) RESULT ( is_start_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid LOGICAL :: is_start_time TYPE(WRFU_Time) :: start_time, current_time CALL domain_clock_get( grid, current_time=current_time, & start_time=start_time ) is_start_time = ( current_time == start_time ) END FUNCTION domain_clockisstarttime FUNCTION domain_clockissimstarttime ( grid ) RESULT ( is_sim_start_time ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid LOGICAL :: is_sim_start_time TYPE(WRFU_Time) :: simulationStartTime, current_time CALL domain_clock_get( grid, current_time=current_time, & simulationStartTime=simulationStartTime ) is_sim_start_time = ( current_time == simulationStartTime ) END FUNCTION domain_clockissimstarttime SUBROUTINE domain_clock_create( grid, StartTime, & StopTime, & TimeStep ) IMPLICIT NONE TYPE(domain), INTENT(INOUT) :: grid TYPE(WRFU_Time), INTENT(IN ) :: StartTime TYPE(WRFU_Time), INTENT(IN ) :: StopTime TYPE(WRFU_TimeInterval), INTENT(IN ) :: TimeStep INTEGER :: rc grid%domain_clock = WRFU_ClockCreate( TimeStep= TimeStep, & StartTime=StartTime, & StopTime= StopTime, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8681,& 'domain_clock_create: WRFU_ClockCreate() failed' ) ENDIF grid%domain_clock_created = .TRUE. RETURN END SUBROUTINE domain_clock_create SUBROUTINE domain_alarm_create( grid, alarm_id, interval, & begin_time, end_time ) USE module_utility IMPLICIT NONE TYPE(domain), POINTER :: grid INTEGER, INTENT(IN) :: alarm_id TYPE(WRFU_TimeInterval), INTENT(IN), OPTIONAL :: interval TYPE(WRFU_TimeInterval), INTENT(IN), OPTIONAL :: begin_time TYPE(WRFU_TimeInterval), INTENT(IN), OPTIONAL :: end_time INTEGER :: rc LOGICAL :: interval_only, all_args, no_args TYPE(WRFU_Time) :: startTime interval_only = .FALSE. all_args = .FALSE. no_args = .FALSE. IF ( ( .NOT. PRESENT( begin_time ) ) .AND. & ( .NOT. PRESENT( end_time ) ) .AND. & ( PRESENT( interval ) ) ) THEN interval_only = .TRUE. ELSE IF ( ( .NOT. PRESENT( begin_time ) ) .AND. & ( .NOT. PRESENT( end_time ) ) .AND. & ( .NOT. PRESENT( interval ) ) ) THEN no_args = .TRUE. ELSE IF ( ( PRESENT( begin_time ) ) .AND. & ( PRESENT( end_time ) ) .AND. & ( PRESENT( interval ) ) ) THEN all_args = .TRUE. ELSE CALL wrf_error_fatal3("",8728,& 'ERROR in domain_alarm_create: bad argument list' ) ENDIF CALL domain_clock_get( grid, start_time=startTime ) IF ( interval_only ) THEN grid%io_intervals( alarm_id ) = interval grid%alarms( alarm_id ) = & WRFU_AlarmCreate( clock=grid%domain_clock, & RingInterval=interval, & rc=rc ) ELSE IF ( no_args ) THEN grid%alarms( alarm_id ) = & WRFU_AlarmCreate( clock=grid%domain_clock, & RingTime=startTime, & rc=rc ) ELSE IF ( all_args ) THEN grid%io_intervals( alarm_id ) = interval grid%alarms( alarm_id ) = & WRFU_AlarmCreate( clock=grid%domain_clock, & RingTime=startTime + begin_time, & RingInterval=interval, & StopTime=startTime + end_time, & rc=rc ) ENDIF IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8753,& 'domain_alarm_create: WRFU_AlarmCreate() failed' ) ENDIF CALL WRFU_AlarmRingerOff( grid%alarms( alarm_id ) , rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8758,& 'domain_alarm_create: WRFU_AlarmRingerOff() failed' ) ENDIF grid%alarms_created( alarm_id ) = .TRUE. END SUBROUTINE domain_alarm_create SUBROUTINE domain_clock_set( grid, current_timestr, & stop_timestr, & time_step_seconds ) IMPLICIT NONE TYPE(domain), INTENT(INOUT) :: grid CHARACTER (LEN=*), INTENT(IN ), OPTIONAL :: current_timestr CHARACTER (LEN=*), INTENT(IN ), OPTIONAL :: stop_timestr INTEGER, INTENT(IN ), OPTIONAL :: time_step_seconds TYPE(WRFU_Time) :: lcl_currtime, lcl_stoptime TYPE(WRFU_TimeInterval) :: tmpTimeInterval INTEGER :: rc IF ( PRESENT( current_timestr ) ) THEN CALL wrf_atotime( current_timestr(1:19), lcl_currtime ) CALL WRFU_ClockSet( grid%domain_clock, currTime=lcl_currtime, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8789,& 'domain_clock_set: WRFU_ClockSet(CurrTime) failed' ) ENDIF ENDIF IF ( PRESENT( stop_timestr ) ) THEN CALL wrf_atotime( stop_timestr(1:19), lcl_stoptime ) CALL WRFU_ClockSet( grid%domain_clock, stopTime=lcl_stoptime, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8798,& 'domain_clock_set: WRFU_ClockSet(StopTime) failed' ) ENDIF ENDIF IF ( PRESENT( time_step_seconds ) ) THEN CALL WRFU_TimeIntervalSet( tmpTimeInterval, & S=time_step_seconds, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8806,& 'domain_clock_set: WRFU_TimeIntervalSet failed' ) ENDIF CALL WRFU_ClockSet ( grid%domain_clock, & timeStep=tmpTimeInterval, & rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8813,& 'domain_clock_set: WRFU_ClockSet(TimeStep) failed' ) ENDIF ENDIF RETURN END SUBROUTINE domain_clock_set SUBROUTINE domain_clockprint ( level, grid, pre_str ) IMPLICIT NONE INTEGER, INTENT( IN) :: level TYPE(domain), INTENT( IN) :: grid CHARACTER (LEN=*), INTENT( IN) :: pre_str CALL wrf_clockprint ( level, grid%domain_clock, pre_str ) RETURN END SUBROUTINE domain_clockprint SUBROUTINE domain_clockadvance ( grid ) IMPLICIT NONE TYPE(domain), INTENT(INOUT) :: grid INTEGER :: rc CALL domain_clockprint ( 250, grid, & 'DEBUG domain_clockadvance(): before WRFU_ClockAdvance,' ) CALL WRFU_ClockAdvance( grid%domain_clock, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8843,& 'domain_clockadvance: WRFU_ClockAdvance() failed' ) ENDIF CALL domain_clockprint ( 250, grid, & 'DEBUG domain_clockadvance(): after WRFU_ClockAdvance,' ) CALL domain_clock_get( grid, minutesSinceSimulationStart=grid%xtime ) CALL domain_clock_get( grid, currentDayOfYearReal=grid%julian ) RETURN END SUBROUTINE domain_clockadvance SUBROUTINE domain_setgmtetc ( grid, start_of_simulation ) IMPLICIT NONE TYPE (domain), INTENT(INOUT) :: grid LOGICAL, INTENT( OUT) :: start_of_simulation CHARACTER (LEN=132) :: message TYPE(WRFU_Time) :: simStartTime INTEGER :: hr, mn, sec, ms, rc CALL domain_clockprint(150, grid, & 'DEBUG domain_setgmtetc(): get simStartTime from clock,') CALL domain_clock_get( grid, simulationStartTime=simStartTime, & simulationStartTimeStr=message ) CALL WRFU_TimeGet( simStartTime, YY=grid%julyr, dayOfYear=grid%julday, & H=hr, M=mn, S=sec, MS=ms, rc=rc) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",8874,& 'domain_setgmtetc: WRFU_TimeGet() failed' ) ENDIF WRITE( wrf_err_message , * ) 'DEBUG domain_setgmtetc(): simulation start time = [',TRIM( message ),']' CALL wrf_debug( 150, TRIM(wrf_err_message) ) grid%gmt=hr+real(mn)/60.+real(sec)/3600.+real(ms)/(1000*3600) WRITE( wrf_err_message , * ) 'DEBUG domain_setgmtetc(): julyr,hr,mn,sec,ms,julday = ', & grid%julyr,hr,mn,sec,ms,grid%julday CALL wrf_debug( 150, TRIM(wrf_err_message) ) WRITE( wrf_err_message , * ) 'DEBUG domain_setgmtetc(): gmt = ',grid%gmt CALL wrf_debug( 150, TRIM(wrf_err_message) ) start_of_simulation = domain_ClockIsSimStartTime(grid) RETURN END SUBROUTINE domain_setgmtetc SUBROUTINE set_current_grid_ptr( grid_ptr ) IMPLICIT NONE TYPE(domain), POINTER :: grid_ptr current_grid_set = .TRUE. current_grid => grid_ptr END SUBROUTINE set_current_grid_ptr LOGICAL FUNCTION Is_alarm_tstep( grid_clock, alarm ) IMPLICIT NONE TYPE (WRFU_Clock), INTENT(in) :: grid_clock TYPE (WRFU_Alarm), INTENT(in) :: alarm LOGICAL :: pred1, pred2, pred3 Is_alarm_tstep = .FALSE. IF ( ASSOCIATED( alarm%alarmint ) ) THEN IF ( alarm%alarmint%Enabled ) THEN IF ( alarm%alarmint%RingIntervalSet ) THEN pred1 = .FALSE. ; pred2 = .FALSE. ; pred3 = .FALSE. IF ( alarm%alarmint%StopTimeSet ) THEN PRED1 = ( grid_clock%clockint%CurrTime + grid_clock%clockint%TimeStep > & alarm%alarmint%StopTime ) ENDIF IF ( alarm%alarmint%RingTimeSet ) THEN PRED2 = ( ( alarm%alarmint%RingTime - & grid_clock%clockint%TimeStep <= & grid_clock%clockint%CurrTime ) & .AND. ( grid_clock%clockint%CurrTime < alarm%alarmint%RingTime ) ) ENDIF IF ( alarm%alarmint%RingIntervalSet ) THEN PRED3 = ( alarm%alarmint%PrevRingTime + & alarm%alarmint%RingInterval <= & grid_clock%clockint%CurrTime + grid_clock%clockint%TimeStep ) ENDIF IF ( ( .NOT. ( pred1 ) ) .AND. & ( ( pred2 ) .OR. ( pred3 ) ) ) THEN Is_alarm_tstep = .TRUE. ENDIF ELSE IF ( alarm%alarmint%RingTimeSet ) THEN IF ( alarm%alarmint%RingTime -& grid_clock%clockint%TimeStep <= & grid_clock%clockint%CurrTime ) THEN Is_alarm_tstep = .TRUE. ENDIF ENDIF ENDIF ENDIF END FUNCTION Is_alarm_tstep LOGICAL FUNCTION Is_alarm_tstep_nphs( grid_clock, alarm, nphs ) IMPLICIT NONE TYPE (WRFU_Clock), INTENT(in) :: grid_clock TYPE (WRFU_Alarm), INTENT(in) :: alarm LOGICAL :: pred1, pred2, pred3 INTEGER :: nphs Is_alarm_tstep_nphs = .FALSE. IF ( ASSOCIATED( alarm%alarmint ) ) THEN IF ( alarm%alarmint%Enabled ) THEN IF ( alarm%alarmint%RingIntervalSet ) THEN pred1 = .FALSE. ; pred2 = .FALSE. ; pred3 = .FALSE. IF ( alarm%alarmint%StopTimeSet ) THEN PRED1 = ( grid_clock%clockint%CurrTime + grid_clock%clockint%TimeStep*nphs > & alarm%alarmint%StopTime ) ENDIF IF ( alarm%alarmint%RingTimeSet ) THEN PRED2 = ( ( alarm%alarmint%RingTime - & grid_clock%clockint%TimeStep <= & grid_clock%clockint%CurrTime ) & .AND. ( grid_clock%clockint%CurrTime < alarm%alarmint%RingTime ) ) ENDIF IF ( alarm%alarmint%RingIntervalSet ) THEN PRED3 = ( alarm%alarmint%PrevRingTime + & alarm%alarmint%RingInterval <= & grid_clock%clockint%CurrTime + grid_clock%clockint%TimeStep*nphs ) ENDIF IF ( ( .NOT. ( pred1 ) ) .AND. & ( ( pred2 ) .OR. ( pred3 ) ) ) THEN Is_alarm_tstep_nphs = .TRUE. ENDIF ELSE IF ( alarm%alarmint%RingTimeSet ) THEN IF ( alarm%alarmint%RingTime -& grid_clock%clockint%TimeStep*nphs <= & grid_clock%clockint%CurrTime ) THEN Is_alarm_tstep_nphs = .TRUE. ENDIF ENDIF ENDIF ENDIF END FUNCTION Is_alarm_tstep_nphs SUBROUTINE domain_time_test_print ( pre_str, name_str, res_str ) IMPLICIT NONE CHARACTER (LEN=*), INTENT(IN) :: pre_str CHARACTER (LEN=*), INTENT(IN) :: name_str CHARACTER (LEN=*), INTENT(IN) :: res_str CHARACTER (LEN=512) :: out_str WRITE (out_str, & FMT="('DOMAIN_TIME_TEST ',A,': ',A,' = ',A)") & TRIM(pre_str), TRIM(name_str), TRIM(res_str) CALL wrf_debug( 0, TRIM(out_str) ) END SUBROUTINE domain_time_test_print SUBROUTINE test_adjust_io_timestr( TI_h, TI_m, TI_s, & CT_yy, CT_mm, CT_dd, CT_h, CT_m, CT_s, & ST_yy, ST_mm, ST_dd, ST_h, ST_m, ST_s, & res_str, testname ) INTEGER, INTENT(IN) :: TI_H INTEGER, INTENT(IN) :: TI_M INTEGER, INTENT(IN) :: TI_S INTEGER, INTENT(IN) :: CT_YY INTEGER, INTENT(IN) :: CT_MM INTEGER, INTENT(IN) :: CT_DD INTEGER, INTENT(IN) :: CT_H INTEGER, INTENT(IN) :: CT_M INTEGER, INTENT(IN) :: CT_S INTEGER, INTENT(IN) :: ST_YY INTEGER, INTENT(IN) :: ST_MM INTEGER, INTENT(IN) :: ST_DD INTEGER, INTENT(IN) :: ST_H INTEGER, INTENT(IN) :: ST_M INTEGER, INTENT(IN) :: ST_S CHARACTER (LEN=*), INTENT(IN) :: res_str CHARACTER (LEN=*), INTENT(IN) :: testname TYPE(WRFU_TimeInterval) :: TI TYPE(WRFU_Time) :: CT, ST LOGICAL :: test_passed INTEGER :: rc CHARACTER(LEN=WRFU_MAXSTR) :: TI_str, CT_str, ST_str, computed_str CALL WRFU_TimeIntervalSet( TI, H=TI_H, M=TI_M, S=TI_S, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeIntervalSet() ', & "module_domain.F" , & 2766 ) CALL WRFU_TimeIntervalGet( TI, timeString=TI_str, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeGet() ', & "module_domain.F" , & 2771 ) CALL WRFU_TimeSet( CT, YY=CT_YY, MM=CT_MM, DD=CT_DD , & H=CT_H, M=CT_M, S=CT_S, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeSet() ', & "module_domain.F" , & 2778 ) CALL WRFU_TimeGet( CT, timeString=CT_str, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeGet() ', & "module_domain.F" , & 2783 ) CALL WRFU_TimeSet( ST, YY=ST_YY, MM=ST_MM, DD=ST_DD , & H=ST_H, M=ST_M, S=ST_S, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeSet() ', & "module_domain.F" , & 2790 ) CALL WRFU_TimeGet( ST, timeString=ST_str, rc=rc ) CALL wrf_check_error( WRFU_SUCCESS, rc, & 'FAIL: '//TRIM(testname)//'WRFU_TimeGet() ', & "module_domain.F" , & 2795 ) CALL adjust_io_timestr ( TI, CT, ST, computed_str ) test_passed = .FALSE. IF ( LEN_TRIM(res_str) == LEN_TRIM(computed_str) ) THEN IF ( res_str(1:LEN_TRIM(res_str)) == computed_str(1:LEN_TRIM(computed_str)) ) THEN test_passed = .TRUE. ENDIF ENDIF IF ( test_passed ) THEN WRITE(*,FMT='(A)') 'PASS: '//TRIM(testname) ELSE WRITE(*,*) 'FAIL: ',TRIM(testname),': adjust_io_timestr(', & TRIM(TI_str),',',TRIM(CT_str),',',TRIM(ST_str),') expected <', & TRIM(res_str),'> but computed <',TRIM(computed_str),'>' ENDIF END SUBROUTINE test_adjust_io_timestr SUBROUTINE domain_time_test ( grid, pre_str ) IMPLICIT NONE TYPE(domain), INTENT(IN) :: grid CHARACTER (LEN=*), INTENT(IN) :: pre_str LOGICAL, SAVE :: one_time_tests_done = .FALSE. REAL :: minutesSinceSimulationStart INTEGER :: advance_count, rc REAL :: currentDayOfYearReal TYPE(WRFU_TimeInterval) :: timeSinceSimulationStart TYPE(WRFU_Time) :: simulationStartTime CHARACTER (LEN=512) :: res_str LOGICAL :: self_test_domain CALL nl_get_self_test_domain( 1, self_test_domain ) IF ( self_test_domain ) THEN CALL domain_clock_get( grid, advanceCount=advance_count ) WRITE ( res_str, FMT="(I8.8)" ) advance_count CALL domain_time_test_print( pre_str, 'advanceCount', res_str ) CALL domain_clock_get( grid, currentDayOfYearReal=currentDayOfYearReal ) WRITE ( res_str, FMT='(F10.6)' ) currentDayOfYearReal CALL domain_time_test_print( pre_str, 'currentDayOfYearReal', res_str ) CALL domain_clock_get( grid, minutesSinceSimulationStart=minutesSinceSimulationStart ) WRITE ( res_str, FMT='(F10.6)' ) minutesSinceSimulationStart CALL domain_time_test_print( pre_str, 'minutesSinceSimulationStart', res_str ) CALL domain_clock_get( grid, current_timestr=res_str ) CALL domain_time_test_print( pre_str, 'current_timestr', res_str ) CALL domain_clock_get( grid, current_timestr_frac=res_str ) CALL domain_time_test_print( pre_str, 'current_timestr_frac', res_str ) CALL domain_clock_get( grid, timeSinceSimulationStart=timeSinceSimulationStart ) CALL WRFU_TimeIntervalGet( timeSinceSimulationStart, timeString=res_str, rc=rc ) IF ( rc /= WRFU_SUCCESS ) THEN CALL wrf_error_fatal3("",9159,& 'domain_time_test: WRFU_TimeIntervalGet() failed' ) ENDIF CALL domain_time_test_print( pre_str, 'timeSinceSimulationStart', res_str ) IF ( .NOT. one_time_tests_done ) THEN one_time_tests_done = .TRUE. CALL domain_clock_get( grid, simulationStartTimeStr=res_str ) CALL domain_time_test_print( pre_str, 'simulationStartTime', res_str ) CALL domain_clock_get( grid, start_timestr=res_str ) CALL domain_time_test_print( pre_str, 'start_timestr', res_str ) CALL domain_clock_get( grid, stop_timestr=res_str ) CALL domain_time_test_print( pre_str, 'stop_timestr', res_str ) CALL domain_clock_get( grid, time_stepstr=res_str ) CALL domain_time_test_print( pre_str, 'time_stepstr', res_str ) CALL domain_clock_get( grid, time_stepstr_frac=res_str ) CALL domain_time_test_print( pre_str, 'time_stepstr_frac', res_str ) CALL test_adjust_io_timestr( TI_h=3, TI_m=0, TI_s=0, & CT_yy=2000, CT_mm=1, CT_dd=26, CT_h=0, CT_m=0, CT_s=0, & ST_yy=2000, ST_mm=1, ST_dd=24, ST_h=12, ST_m=0, ST_s=0, & res_str='2000-01-26_00:00:00', testname='adjust_io_timestr_1' ) ENDIF ENDIF RETURN END SUBROUTINE domain_time_test END MODULE module_domain SUBROUTINE get_current_time_string( time_str ) USE module_domain IMPLICIT NONE CHARACTER (LEN=*), INTENT(OUT) :: time_str INTEGER :: debug_level_lcl time_str = '' IF ( current_grid_set ) THEN IF ( current_grid%time_set ) THEN CALL get_wrf_debug_level( debug_level_lcl ) CALL set_wrf_debug_level ( 0 ) current_grid_set = .FALSE. CALL domain_clock_get( current_grid, current_timestr_frac=time_str ) CALL set_wrf_debug_level ( debug_level_lcl ) current_grid_set = .TRUE. ENDIF ENDIF END SUBROUTINE get_current_time_string SUBROUTINE get_current_grid_name( grid_str ) USE module_domain IMPLICIT NONE CHARACTER (LEN=*), INTENT(OUT) :: grid_str grid_str = '' IF ( current_grid_set ) THEN WRITE(grid_str,FMT="('d',I2.2)") current_grid%id ENDIF END SUBROUTINE get_current_grid_name SUBROUTINE get_ijk_from_grid_ext ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey ) USE module_domain IMPLICIT NONE TYPE( domain ), INTENT (IN) :: grid INTEGER, INTENT(OUT) :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey CALL get_ijk_from_grid2 ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe ) data_ordering : SELECT CASE ( model_data_order ) CASE ( DATA_ORDER_XYZ ) imsx = grid%sm31x ; imex = grid%em31x ; jmsx = grid%sm32x ; jmex = grid%em32x ; kmsx = grid%sm33x ; kmex = grid%em33x ; ipsx = grid%sp31x ; ipex = grid%ep31x ; jpsx = grid%sp32x ; jpex = grid%ep32x ; kpsx = grid%sp33x ; kpex = grid%ep33x ; imsy = grid%sm31y ; imey = grid%em31y ; jmsy = grid%sm32y ; jmey = grid%em32y ; kmsy = grid%sm33y ; kmey = grid%em33y ; ipsy = grid%sp31y ; ipey = grid%ep31y ; jpsy = grid%sp32y ; jpey = grid%ep32y ; kpsy = grid%sp33y ; kpey = grid%ep33y ; CASE ( DATA_ORDER_YXZ ) imsx = grid%sm32x ; imex = grid%em32x ; jmsx = grid%sm31x ; jmex = grid%em31x ; kmsx = grid%sm33x ; kmex = grid%em33x ; ipsx = grid%sp32x ; ipex = grid%ep32x ; jpsx = grid%sp31x ; jpex = grid%ep31x ; kpsx = grid%sp33x ; kpex = grid%ep33x ; imsy = grid%sm32y ; imey = grid%em32y ; jmsy = grid%sm31y ; jmey = grid%em31y ; kmsy = grid%sm33y ; kmey = grid%em33y ; ipsy = grid%sp32y ; ipey = grid%ep32y ; jpsy = grid%sp31y ; jpey = grid%ep31y ; kpsy = grid%sp33y ; kpey = grid%ep33y ; CASE ( DATA_ORDER_ZXY ) imsx = grid%sm32x ; imex = grid%em32x ; jmsx = grid%sm33x ; jmex = grid%em33x ; kmsx = grid%sm31x ; kmex = grid%em31x ; ipsx = grid%sp32x ; ipex = grid%ep32x ; jpsx = grid%sp33x ; jpex = grid%ep33x ; kpsx = grid%sp31x ; kpex = grid%ep31x ; imsy = grid%sm32y ; imey = grid%em32y ; jmsy = grid%sm33y ; jmey = grid%em33y ; kmsy = grid%sm31y ; kmey = grid%em31y ; ipsy = grid%sp32y ; ipey = grid%ep32y ; jpsy = grid%sp33y ; jpey = grid%ep33y ; kpsy = grid%sp31y ; kpey = grid%ep31y ; CASE ( DATA_ORDER_ZYX ) imsx = grid%sm33x ; imex = grid%em33x ; jmsx = grid%sm32x ; jmex = grid%em32x ; kmsx = grid%sm31x ; kmex = grid%em31x ; ipsx = grid%sp33x ; ipex = grid%ep33x ; jpsx = grid%sp32x ; jpex = grid%ep32x ; kpsx = grid%sp31x ; kpex = grid%ep31x ; imsy = grid%sm33y ; imey = grid%em33y ; jmsy = grid%sm32y ; jmey = grid%em32y ; kmsy = grid%sm31y ; kmey = grid%em31y ; ipsy = grid%sp33y ; ipey = grid%ep33y ; jpsy = grid%sp32y ; jpey = grid%ep32y ; kpsy = grid%sp31y ; kpey = grid%ep31y ; CASE ( DATA_ORDER_XZY ) imsx = grid%sm31x ; imex = grid%em31x ; jmsx = grid%sm33x ; jmex = grid%em33x ; kmsx = grid%sm32x ; kmex = grid%em32x ; ipsx = grid%sp31x ; ipex = grid%ep31x ; jpsx = grid%sp33x ; jpex = grid%ep33x ; kpsx = grid%sp32x ; kpex = grid%ep32x ; imsy = grid%sm31y ; imey = grid%em31y ; jmsy = grid%sm33y ; jmey = grid%em33y ; kmsy = grid%sm32y ; kmey = grid%em32y ; ipsy = grid%sp31y ; ipey = grid%ep31y ; jpsy = grid%sp33y ; jpey = grid%ep33y ; kpsy = grid%sp32y ; kpey = grid%ep32y ; CASE ( DATA_ORDER_YZX ) imsx = grid%sm33x ; imex = grid%em33x ; jmsx = grid%sm31x ; jmex = grid%em31x ; kmsx = grid%sm32x ; kmex = grid%em32x ; ipsx = grid%sp33x ; ipex = grid%ep33x ; jpsx = grid%sp31x ; jpex = grid%ep31x ; kpsx = grid%sp32x ; kpex = grid%ep32x ; imsy = grid%sm33y ; imey = grid%em33y ; jmsy = grid%sm31y ; jmey = grid%em31y ; kmsy = grid%sm32y ; kmey = grid%em32y ; ipsy = grid%sp33y ; ipey = grid%ep33y ; jpsy = grid%sp31y ; jpey = grid%ep31y ; kpsy = grid%sp32y ; kpey = grid%ep32y ; END SELECT data_ordering END SUBROUTINE get_ijk_from_grid_ext SUBROUTINE get_ijk_from_subgrid_ext ( grid , & ids0, ide0, jds0, jde0, kds0, kde0, & ims0, ime0, jms0, jme0, kms0, kme0, & ips0, ipe0, jps0, jpe0, kps0, kpe0 ) USE module_domain IMPLICIT NONE TYPE( domain ), INTENT (IN) :: grid INTEGER, INTENT(OUT) :: & ids0, ide0, jds0, jde0, kds0, kde0, & ims0, ime0, jms0, jme0, kms0, kme0, & ips0, ipe0, jps0, jpe0, kps0, kpe0 INTEGER :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe CALL get_ijk_from_grid ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe ) ids0 = ids ide0 = ide * grid%sr_x ims0 = (ims-1)*grid%sr_x+1 ime0 = ime * grid%sr_x ips0 = (ips-1)*grid%sr_x+1 ipe0 = ipe * grid%sr_x jds0 = jds jde0 = jde * grid%sr_y jms0 = (jms-1)*grid%sr_y+1 jme0 = jme * grid%sr_y jps0 = (jps-1)*grid%sr_y+1 jpe0 = jpe * grid%sr_y kds0 = kds kde0 = kde kms0 = kms kme0 = kme kps0 = kps kpe0 = kpe RETURN END SUBROUTINE get_ijk_from_subgrid_ext SUBROUTINE get_dims_from_grid_id ( id & ,ds, de & ,ms, me & ,ps, pe & ,mxs, mxe & ,pxs, pxe & ,mys, mye & ,pys, pye ) USE module_domain, ONLY : domain, head_grid, find_grid_by_id IMPLICIT NONE TYPE( domain ), POINTER :: grid INTEGER, INTENT(IN ) :: id INTEGER, DIMENSION(3), INTENT(INOUT) :: & ds, de & ,ms, me & ,ps, pe & ,mxs, mxe & ,pxs, pxe & ,mys, mye & ,pys, pye CHARACTER*256 mess NULLIFY( grid ) CALL find_grid_by_id ( id, head_grid, grid ) IF ( ASSOCIATED(grid) ) THEN ds(1) = grid%sd31 ; de(1) = grid%ed31 ; ds(2) = grid%sd32 ; de(2) = grid%ed32 ; ds(3) = grid%sd33 ; de(3) = grid%ed33 ; ms(1) = grid%sm31 ; me(1) = grid%em31 ; ms(2) = grid%sm32 ; me(2) = grid%em32 ; ms(3) = grid%sm33 ; me(3) = grid%em33 ; ps(1) = grid%sp31 ; pe(1) = grid%ep31 ; ps(2) = grid%sp32 ; pe(2) = grid%ep32 ; ps(3) = grid%sp33 ; pe(3) = grid%ep33 ; mxs(1) = grid%sm31x ; mxe(1) = grid%em31x mxs(2) = grid%sm32x ; mxe(2) = grid%em32x mxs(3) = grid%sm33x ; mxe(3) = grid%em33x pxs(1) = grid%sp31x ; pxe(1) = grid%ep31x pxs(2) = grid%sp32x ; pxe(2) = grid%ep32x pxs(3) = grid%sp33x ; pxe(3) = grid%ep33x mys(1) = grid%sm31y ; mye(1) = grid%em31y mys(2) = grid%sm32y ; mye(2) = grid%em32y mys(3) = grid%sm33y ; mye(3) = grid%em33y pys(1) = grid%sp31y ; pye(1) = grid%ep31y pys(2) = grid%sp32y ; pye(2) = grid%ep32y pys(3) = grid%sp33y ; pye(3) = grid%ep33y ELSE WRITE(mess,*)'internal error: get_ijk_from_grid_id: no such grid id:',id CALL wrf_error_fatal3("",9413,& TRIM(mess)) ENDIF END SUBROUTINE get_dims_from_grid_id SUBROUTINE get_ijk_from_grid_id ( id , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey ) USE module_domain, ONLY : domain, head_grid, find_grid_by_id, get_ijk_from_grid IMPLICIT NONE TYPE( domain ), POINTER :: grid INTEGER, INTENT(IN ) :: id INTEGER, INTENT(OUT) :: & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey CHARACTER*256 mess NULLIFY( grid ) CALL find_grid_by_id ( id, head_grid, grid ) IF ( ASSOCIATED(grid) ) THEN CALL get_ijk_from_grid ( grid , & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & ips, ipe, jps, jpe, kps, kpe, & imsx, imex, jmsx, jmex, kmsx, kmex, & ipsx, ipex, jpsx, jpex, kpsx, kpex, & imsy, imey, jmsy, jmey, kmsy, kmey, & ipsy, ipey, jpsy, jpey, kpsy, kpey ) ELSE WRITE(mess,*)'internal error: get_ijk_from_grid_id: no such grid id:',id CALL wrf_error_fatal3("",9457,& TRIM(mess)) ENDIF END SUBROUTINE get_ijk_from_grid_id SUBROUTINE modify_io_masks ( id ) USE module_domain, ONLY : domain, modify_io_masks1, head_grid, find_grid_by_id IMPLICIT NONE INTEGER, INTENT(IN) :: id TYPE(domain), POINTER :: grid CALL find_grid_by_id( id, head_grid, grid ) IF ( ASSOCIATED( grid ) ) CALL modify_io_masks1( grid, id ) RETURN END SUBROUTINE modify_io_masks