diff --git a/src/SURFEX/zoom_pgd_isba.F90 b/src/SURFEX/zoom_pgd_isba.F90 index 0ff1e209ffc14bd7f3caa6101d6e2b6ca63275e3..4ea66e8b9705691121468ba2018d68478da4b08d 100644 --- a/src/SURFEX/zoom_pgd_isba.F90 +++ b/src/SURFEX/zoom_pgd_isba.F90 @@ -52,6 +52,7 @@ USE MODD_ISBA_OPTIONS_n, ONLY : ISBA_OPTIONS_t USE MODD_ISBA_n, ONLY : ISBA_S_t, ISBA_K_t USE MODD_SURF_ATM_GRID_n, ONLY : SURF_ATM_GRID_t USE MODD_SURF_ATM_n, ONLY : SURF_ATM_t +USE MODD_SURF_PAR, ONLY : LEN_HREC USE MODD_SSO_n, ONLY : SSO_t USE MODD_MEGAN_SURF_FIELDS_n, ONLY : MEGAN_SURF_FIELDS_t ! @@ -115,6 +116,8 @@ INTEGER :: IRESP INTEGER :: ILUOUT INTEGER :: IL ! total 1D dimension (output grid, total surface) INTEGER :: ILU ! total 1D dimension (output grid, ISBA points only) +INTEGER :: JLAYER +CHARACTER(LEN=LEN_HREC) :: YRECFM ! Name of the article to be read REAL, DIMENSION(:), ALLOCATABLE :: ZAOSIP ! A/S i+ on all surface points REAL, DIMENSION(:), ALLOCATABLE :: ZAOSIM ! A/S i- on all surface points REAL, DIMENSION(:), ALLOCATABLE :: ZAOSJP ! A/S j+ on all surface points @@ -142,6 +145,17 @@ IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_ISBA',0,ZHOOK_HANDLE) CALL READ_SURF(HINIFILETYPE,'VERSION',IVERSION,IRESP) CALL READ_SURF(HINIFILETYPE,'BUG',IBUGFIX,IRESP) CALL READ_SURF(HINIFILETYPE,'PATCH_NUMBER',IO%NPATCH,IRESP) +!!* Name of each tile (patch) #remove with 160 characters in output +!! +ALLOCATE(DTV%CPATCH_NAME(IO%NPATCH,2)) +DO JLAYER=1,IO%NPATCH + WRITE(YRECFM,FMT='(A10,I2.2)') 'NPATCH_NAM',JLAYER + CALL READ_SURF(HINIFILETYPE,YRECFM,DTV%CPATCH_NAME(JLAYER,1),IRESP) + ! + !* Composition of each patch (True / False liste + if ecosg and irrigated 'IRRIG ') + WRITE(YRECFM,FMT='(A10,I2.2)') 'NPATCH_VEG',JLAYER + CALL READ_SURF(HINIFILETYPE,YRECFM,DTV%CPATCH_NAME(JLAYER,2),IRESP) +ENDDO ! ALLOCATE(IO%LMEB_PATCH(IO%NPATCH)) ! diff --git a/src/SURFEX/zoom_pgd_teb.F90 b/src/SURFEX/zoom_pgd_teb.F90 index 2af5d7329eb29a2d56203dfb90232b2a3752daa8..329ad941262d051a91f88ddd9a3722dbd0ca7397 100644 --- a/src/SURFEX/zoom_pgd_teb.F90 +++ b/src/SURFEX/zoom_pgd_teb.F90 @@ -74,6 +74,7 @@ USE MODI_READ_PGD_TEB_PAR_n USE MODI_READ_PGD_TEB_HYDRO_PAR_n USE MODI_CLOSE_AUX_IO_SURF USE MODI_CLEAN_PREP_OUTPUT_GRID +USE MODI_HOR_INTERPOL ! USE YOMHOOK ,ONLY : LHOOK, DR_HOOK USE PARKIND1 ,ONLY : JPRB @@ -121,6 +122,8 @@ INTEGER :: JPATCH ! TEB patch REAL(KIND=JPRB) :: ZHOOK_HANDLE INTEGER :: IVERSION INTEGER :: IBUGFIX +REAL, DIMENSION(:,:), POINTER :: ZIN ! field on all surface points +REAL, DIMENSION(:), POINTER :: ZFIELD ! field read CHARACTER(LEN=4 ) :: YLVL CHARACTER(LEN=LEN_HREC) :: YRECFM ! Name of the article to be read !------------------------------------------------------------------------------ @@ -232,6 +235,43 @@ DO JPATCH=1,TOP%NTEB_PATCH CALL READ_PGD_TEB_PAR_n(DTCO, U, GCP, BDD, DTB, DTT, TG%NDIM, TOP, BOP,& HPROGRAM,'A') ! +IF (IVERSION>=9) THEN + CALL READ_SURF(HPROGRAM,'GROUND_LAYER',IO%NGROUND_LAYER,IRESP) +ELSE IF (IVERSION>7 .OR. IVERSION==7 .AND. IBUGFIX>=3) THEN + CALL READ_SURF(HPROGRAM,'GD_LAYER',IO%NGROUND_LAYER,IRESP) +ELSE + CALL READ_SURF(HPROGRAM,'TWN_LAYER',IO%NGROUND_LAYER,IRESP) +END IF +!* sand +! +ALLOCATE(ZIN(INI,IO%NGROUND_LAYER)) +ALLOCATE(ZFIELD(INI)) +YRECFM='TWN_SAND' +IF (IVERSION>7 .OR. IVERSION==7 .AND. IBUGFIX>=3) YRECFM='GD_SAND' +CALL READ_SURF(HPROGRAM,YRECFM,ZFIELD,IRESP,HDIR='A') +DO JLAYER=1,IO%NGROUND_LAYER + ZIN(:,JLAYER) = ZFIELD(:) +END DO +ALLOCATE(K%XSAND(ILU,IO%NGROUND_LAYER)) +CALL HOR_INTERPOL(DTCO, U, GCP, ILUOUT,ZIN,K%XSAND) +#ifdef MNH_PARALLEL + CALL MPPDB_CHECK_SURFEX3D(K%XSAND,"ZOOM_PGD_TEB_GARDEB:XSAND",PRECISION,ILUOUT, 'TOWN ',IO%NGROUND_LAYER) +#endif +! +!* clay +! +YRECFM='TWN_CLAY' +IF (IVERSION>7 .OR. IVERSION==7 .AND. IBUGFIX>=3) YRECFM='GD_CLAY' +CALL READ_SURF(HPROGRAM,YRECFM,ZFIELD,IRESP,HDIR='A') +DO JLAYER=1,IO%NGROUND_LAYER + ZIN(:,JLAYER) = ZFIELD(:) +END DO +ALLOCATE(K%XCLAY(ILU,IO%NGROUND_LAYER)) +CALL HOR_INTERPOL(DTCO, U, GCP, ILUOUT,ZIN,K%XCLAY) +#ifdef MNH_PARALLEL + CALL MPPDB_CHECK_SURFEX3D(K%XCLAY,"ZOOM_PGD_TEB_GARDEB:XCLAY",PRECISION,ILUOUT, 'TOWN ',IO%NGROUND_LAYER) +#endif +DEALLOCATE(ZIN) !------------------------------------------------------------------------------ ! !* 5. Gardens @@ -333,38 +373,6 @@ ENDIF ! ALLOCATE(IO%LMEB_PATCH(1)) IO%LMEB_PATCH(:) = .FALSE. - -!* sand -! -ALLOCATE(ZIN(INI,IO%NGROUND_LAYER)) -YRECFM='TWN_SAND' -IF (IVERSION>7 .OR. IVERSION==7 .AND. IBUGFIX>=3) YRECFM='GD_SAND' - CALL READ_SURF(HPROGRAM,YRECFM,ZFIELD,IRESP,HDIR='A') -DO JLAYER=1,IO%NGROUND_LAYER - ZIN(:,JLAYER) = ZFIELD(:) -END DO -ALLOCATE(K%XSAND(ILU,IO%NGROUND_LAYER)) - CALL HOR_INTERPOL(DTCO, U, GCP, ILUOUT,ZIN,K%XSAND) -#ifdef MNH_PARALLEL - CALL MPPDB_CHECK_SURFEX3D(K%XSAND,"ZOOM_PGD_TEB_GARDEB:XSAND",PRECISION,ILUOUT, 'TOWN ',IO%NGROUND_LAYER) -#endif -DEALLOCATE(ZIN) -! -!* clay -! -ALLOCATE(ZIN(INI,IO%NGROUND_LAYER)) -YRECFM='TWN_CLAY' -IF (IVERSION>7 .OR. IVERSION==7 .AND. IBUGFIX>=3) YRECFM='GD_CLAY' - CALL READ_SURF(HPROGRAM,YRECFM,ZFIELD,IRESP,HDIR='A') -DO JLAYER=1,IO%NGROUND_LAYER - ZIN(:,JLAYER) = ZFIELD(:) -END DO -ALLOCATE(K%XCLAY(ILU,IO%NGROUND_LAYER)) - CALL HOR_INTERPOL(DTCO, U, GCP, ILUOUT,ZIN,K%XCLAY) -#ifdef MNH_PARALLEL - CALL MPPDB_CHECK_SURFEX3D(K%XCLAY,"ZOOM_PGD_TEB_GARDEB:XCLAY",PRECISION,ILUOUT, 'TOWN ',IO%NGROUND_LAYER) -#endif -DEALLOCATE(ZIN) ! !* runoff & drainage !