diff --git a/src/LIB/SURCOUCHE/src/mode_field.f90 b/src/LIB/SURCOUCHE/src/mode_field.f90 index 766e989c89c3842d2ffec8f281398920f1174e88..8eb15734f1ad283e709348562216a6cddab5fb4d 100644 --- a/src/LIB/SURCOUCHE/src/mode_field.f90 +++ b/src/LIB/SURCOUCHE/src/mode_field.f90 @@ -4,14 +4,24 @@ !MNH_LIC for details. version 1. MODULE MODE_FIELD ! +USE MODD_PARAMETERS +! IMPLICIT NONE ! -INTEGER,PRIVATE,PARAMETER :: MAXFIELDS = 6 +INTEGER,PRIVATE,PARAMETER :: MAXFIELDS = 9 INTEGER,PARAMETER :: TYPEUNDEF = -1, TYPEINT = 1, TYPELOG = 2, TYPEREAL = 3, TYPECHAR = 4 ! +TYPE TFIELDPTR_X2D + REAL,DIMENSION(:,:), POINTER :: DATA => NULL() +END TYPE TFIELDPTR_X2D +! +TYPE TFIELDPTR_X3D + REAL,DIMENSION(:,:,:),POINTER :: DATA => NULL() +END TYPE TFIELDPTR_X3D +! !Structure describing the characteristics of a field TYPE TFIELDDATA - CHARACTER(LEN=16) :: CMNHNAME = '' !Name of the field (for MesoNH, non CF convention) + CHARACTER(LEN=NMNHNAMELGTMAX) :: CMNHNAME = '' !Name of the field (for MesoNH, non CF convention) CHARACTER(LEN=32) :: CSTDNAME = '' !Standard name (CF convention) CHARACTER(LEN=32) :: CLONGNAME = '' !Long name (CF convention) CHARACTER(LEN=32) :: CUNITS = '' !Canonical units (CF convention) @@ -19,15 +29,20 @@ TYPE TFIELDDATA CHARACTER(LEN=100) :: CCOMMENT = '' !Comment (for MesoNH, non CF convention) INTEGER :: NGRID = -1 !Localization on the model grid INTEGER :: NTYPE = TYPEUNDEF !Datatype + INTEGER :: NDIMS = 0 !Number of dimensions + TYPE(TFIELDPTR_X2D),DIMENSION(:),ALLOCATABLE :: TFIELD_X2D !Pointer to the real 2D fields (one per nested mesh) + TYPE(TFIELDPTR_X3D),DIMENSION(:),ALLOCATABLE :: TFIELD_X3D !Pointer to the real 3D fields (one per nested mesh) END TYPE TFIELDDATA ! -LOGICAL :: LFIELDLIST_ISINIT = .FALSE. -TYPE(TFIELDDATA),DIMENSION(MAXFIELDS) :: TFIELDLIST +LOGICAL,SAVE :: LFIELDLIST_ISINIT = .FALSE. +TYPE(TFIELDDATA),DIMENSION(MAXFIELDS),SAVE :: TFIELDLIST ! CONTAINS ! SUBROUTINE INI_FIELD_LIST() ! +USE MODD_CONF, ONLY: NMODEL +! INTEGER :: IDX ! !F90/95: TFIELDLIST(1) = TFIELDDATA('UT','x_wind','m s-1','XY','X_Y_Z_U component of wind (m/s)',2) @@ -35,6 +50,7 @@ INTEGER :: IDX !TFIELDLIST(1) = TFIELDDATA(CMNHNAME='UT',CSTDNAME='x_wind',CUNITS='m s-1',CDIR='XY',& ! CCOMMENT='X_Y_Z_U component of wind (m/s)',NGRID=2) ! +PRINT *,'PW: INI_FIELD_LIST called' IF (LFIELDLIST_ISINIT) THEN PRINT *,'ERROR: INI_FIELD_LIST already called' RETURN @@ -43,14 +59,15 @@ LFIELDLIST_ISINIT = .TRUE. ! IDX = 1 ! -TFIELDLIST(IDX)%CMNHNAME = 'BIBUSER' +TFIELDLIST(IDX)%CMNHNAME = 'MASDEV' TFIELDLIST(IDX)%CSTDNAME = '' -TFIELDLIST(IDX)%CLONGNAME = 'MesoNH: user binary library' +TFIELDLIST(IDX)%CLONGNAME = 'MesoNH version (without bugfix)' TFIELDLIST(IDX)%CUNITS = '' -TFIELDLIST(IDX)%CDIR = '' +TFIELDLIST(IDX)%CDIR = '--' TFIELDLIST(IDX)%CCOMMENT = '' TFIELDLIST(IDX)%NGRID = 0 -TFIELDLIST(IDX)%NTYPE = TYPECHAR +TFIELDLIST(IDX)%NTYPE = TYPEINT +TFIELDLIST(IDX)%NDIMS = 0 IDX = IDX+1 ! TFIELDLIST(IDX)%CMNHNAME = 'BUGFIX' @@ -61,26 +78,40 @@ TFIELDLIST(IDX)%CDIR = '' TFIELDLIST(IDX)%CCOMMENT = '' TFIELDLIST(IDX)%NGRID = 0 TFIELDLIST(IDX)%NTYPE = TYPEINT +TFIELDLIST(IDX)%NDIMS = 0 IDX = IDX+1 ! -TFIELDLIST(IDX)%CMNHNAME = 'FILETYPE' +TFIELDLIST(IDX)%CMNHNAME = 'BIBUSER' TFIELDLIST(IDX)%CSTDNAME = '' -TFIELDLIST(IDX)%CLONGNAME = 'Type of this file for MesoNH' +TFIELDLIST(IDX)%CLONGNAME = 'MesoNH: user binary library' TFIELDLIST(IDX)%CUNITS = '' TFIELDLIST(IDX)%CDIR = '' TFIELDLIST(IDX)%CCOMMENT = '' TFIELDLIST(IDX)%NGRID = 0 TFIELDLIST(IDX)%NTYPE = TYPECHAR +TFIELDLIST(IDX)%NDIMS = 0 IDX = IDX+1 ! -TFIELDLIST(IDX)%CMNHNAME = 'MASDEV' +TFIELDLIST(IDX)%CMNHNAME = 'PROGRAM' TFIELDLIST(IDX)%CSTDNAME = '' -TFIELDLIST(IDX)%CLONGNAME = 'MesoNH version (without bugfix)' +TFIELDLIST(IDX)%CLONGNAME = 'MesoNH family: used program' TFIELDLIST(IDX)%CUNITS = '' -TFIELDLIST(IDX)%CDIR = '--' +TFIELDLIST(IDX)%CDIR = '' TFIELDLIST(IDX)%CCOMMENT = '' TFIELDLIST(IDX)%NGRID = 0 -TFIELDLIST(IDX)%NTYPE = TYPEINT +TFIELDLIST(IDX)%NTYPE = TYPECHAR +TFIELDLIST(IDX)%NDIMS = 0 +IDX = IDX+1 +! +TFIELDLIST(IDX)%CMNHNAME = 'FILETYPE' +TFIELDLIST(IDX)%CSTDNAME = '' +TFIELDLIST(IDX)%CLONGNAME = 'Type of this file for MesoNH' +TFIELDLIST(IDX)%CUNITS = '' +TFIELDLIST(IDX)%CDIR = '' +TFIELDLIST(IDX)%CCOMMENT = '' +TFIELDLIST(IDX)%NGRID = 0 +TFIELDLIST(IDX)%NTYPE = TYPECHAR +TFIELDLIST(IDX)%NDIMS = 0 IDX = IDX+1 ! TFIELDLIST(IDX)%CMNHNAME = 'UT' @@ -91,16 +122,45 @@ TFIELDLIST(IDX)%CDIR = 'XY' TFIELDLIST(IDX)%CCOMMENT = 'X_Y_Z_U component of wind (m/s)' TFIELDLIST(IDX)%NGRID = 2 TFIELDLIST(IDX)%NTYPE = TYPEREAL +TFIELDLIST(IDX)%NDIMS = 3 +ALLOCATE(TFIELDLIST(IDX)%TFIELD_X3D(NMODEL)) IDX = IDX+1 ! -TFIELDLIST(IDX)%CMNHNAME = 'PROGRAM' -TFIELDLIST(IDX)%CSTDNAME = '' -TFIELDLIST(IDX)%CLONGNAME = 'MesoNH family: used program' -TFIELDLIST(IDX)%CUNITS = '' +TFIELDLIST(IDX)%CMNHNAME = 'VT' +TFIELDLIST(IDX)%CSTDNAME = 'y_wind' +TFIELDLIST(IDX)%CLONGNAME = '' +TFIELDLIST(IDX)%CUNITS = 'm s-1' +TFIELDLIST(IDX)%CDIR = 'XY' +TFIELDLIST(IDX)%CCOMMENT = 'X_Y_Z_V component of wind (m/s)' +TFIELDLIST(IDX)%NGRID = 3 +TFIELDLIST(IDX)%NTYPE = TYPEREAL +TFIELDLIST(IDX)%NDIMS = 3 +ALLOCATE(TFIELDLIST(IDX)%TFIELD_X3D(NMODEL)) +IDX = IDX+1 +! +TFIELDLIST(IDX)%CMNHNAME = 'THT' +TFIELDLIST(IDX)%CSTDNAME = 'air_potential_temperature' +TFIELDLIST(IDX)%CLONGNAME = '' +TFIELDLIST(IDX)%CUNITS = 'K' +TFIELDLIST(IDX)%CDIR = 'XY' +TFIELDLIST(IDX)%CCOMMENT = 'X_Y_Z_potential temperature (K)' +TFIELDLIST(IDX)%NGRID = 1 +TFIELDLIST(IDX)%NTYPE = TYPEREAL +TFIELDLIST(IDX)%NDIMS = 3 +ALLOCATE(TFIELDLIST(IDX)%TFIELD_X3D(NMODEL)) +IDX = IDX+1 +! +TFIELDLIST(IDX)%CMNHNAME = 'ACPRR' +TFIELDLIST(IDX)%CSTDNAME = 'rainfall_amount' +TFIELDLIST(IDX)%CLONGNAME = '' +!PW: TODO: CF-convention prefers 'kg m-2' +TFIELDLIST(IDX)%CUNITS = 'm' TFIELDLIST(IDX)%CDIR = '' -TFIELDLIST(IDX)%CCOMMENT = '' -TFIELDLIST(IDX)%NGRID = 0 -TFIELDLIST(IDX)%NTYPE = TYPECHAR +TFIELDLIST(IDX)%CCOMMENT = 'X_Y_ACcumulated Precipitation Rain Rate (m)' +TFIELDLIST(IDX)%NGRID = 1 +TFIELDLIST(IDX)%NTYPE = TYPEREAL +TFIELDLIST(IDX)%NDIMS = 2 +ALLOCATE(TFIELDLIST(IDX)%TFIELD_X2D(NMODEL)) IDX = IDX+1 ! #if 0 @@ -113,6 +173,8 @@ TFIELDLIST(IDX)%CDIR = '' TFIELDLIST(IDX)%CCOMMENT = '' TFIELDLIST(IDX)%NGRID = TFIELDLIST(IDX)%NTYPE = +TFIELDLIST(IDX)%NDIMS = +ALLOCATE(TFIELDLIST(IDX)%TFIELD_xxxD(NMODEL)) IDX = IDX+1 #endif @@ -126,6 +188,16 @@ INTEGER, INTENT(OUT):: KRESP !Return-code ! INTEGER :: JI ! +!PW: TODO: to optimize +!Ideas : +! * Classement alphanumerique + index vers 1er champ commencant par caractere +! * Classement dans l'ordre des ecritures + stockage dernier hit + reboucler depuis le debut +! +IF (.NOT.LFIELDLIST_ISINIT) THEN + PRINT *,'FATAL: FIND_FIELD_ID_FROM_MNHNAME: TFIELDLIST not yet initialized' + STOP +END IF +! KID = 0 KRESP = 0 ! diff --git a/src/LIB/SURCOUCHE/src/mode_fm.f90 b/src/LIB/SURCOUCHE/src/mode_fm.f90 index 643ddb13565b55d93361a2e0a44263ad5cebc7a9..a8b8bdf61d3a69fa841d6524987f10feb076d8ef 100644 --- a/src/LIB/SURCOUCHE/src/mode_fm.f90 +++ b/src/LIB/SURCOUCHE/src/mode_fm.f90 @@ -28,6 +28,7 @@ INTEGER, PARAMETER :: JPPIPE = 10 PUBLIC SET_FMPACK_ll,FMATTR_ll,FMLOOK_ll,FMOPEN_ll,FMCLOS_ll PUBLIC IO_FILE_OPEN_ll, IO_FILE_CLOSE_ll +PUBLIC IO_WRITE_FIELDLIST CONTAINS @@ -573,5 +574,87 @@ WRITE (ILUPRI,*) ' | HFILEM = ',HFILEM END SUBROUTINE FM_ERR +SUBROUTINE IO_WRITE_FIELDLIST(TPOUTPUT,HFIPRI) +! +USE MODD_IO_ll, ONLY: TOUTBAK +USE MODE_FIELD +USE MODE_MODELN_HANDLER, ONLY : GET_CURRENT_MODEL_INDEX +USE MODE_FMWRIT +! +IMPLICIT NONE +! +TYPE(TOUTBAK),POINTER,INTENT(IN) :: TPOUTPUT !Output structure +CHARACTER(LEN=*), INTENT(IN) :: HFIPRI ! File for prints in FM +! +INTEGER :: IDX +INTEGER :: IMI +INTEGER :: IRESP +INTEGER :: JI +! +IMI = GET_CURRENT_MODEL_INDEX() +! +DO JI = 1,SIZE(TPOUTPUT%NFIELDLIST) + IDX = TPOUTPUT%NFIELDLIST(JI) + SELECT CASE (TFIELDLIST(IDX)%NDIMS) + ! + !2D output + ! + CASE (2) + SELECT CASE (TFIELDLIST(IDX)%NTYPE) + ! + !2D real + ! + CASE (TYPEREAL) + IF ( .NOT.ALLOCATED(TFIELDLIST(IDX)%TFIELD_X2D) ) THEN + PRINT *,'FATAL: IO_WRITE_FIELDLIST: TFIELD_X2D is NOT allocated for ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END IF + IF ( .NOT.ASSOCIATED(TFIELDLIST(IDX)%TFIELD_X2D(IMI)%DATA) ) THEN + PRINT *,'FATAL: IO_WRITE_FIELDLIST: TFIELD_X2D%DATA is not associated for ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END IF + CALL IO_WRITE_FIELD(TPOUTPUT%TFILE,TFIELDLIST(IDX),HFIPRI,IRESP,TFIELDLIST(IDX)%TFIELD_X2D(IMI)%DATA) + ! + !2D other types + ! + CASE DEFAULT + PRINT *,'FATAL: IO_WRITE_FIELDLIST: type not yet supported for 2D output of ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END SELECT + ! + !3D output + ! + CASE (3) + SELECT CASE (TFIELDLIST(IDX)%NTYPE) + ! + !3D real + ! + CASE (TYPEREAL) + IF ( .NOT.ALLOCATED(TFIELDLIST(IDX)%TFIELD_X3D) ) THEN + PRINT *,'FATAL: IO_WRITE_FIELDLIST: TFIELD_X3D is NOT allocated for ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END IF + IF ( .NOT.ASSOCIATED(TFIELDLIST(IDX)%TFIELD_X3D(IMI)%DATA) ) THEN + PRINT *,'FATAL: IO_WRITE_FIELDLIST: TFIELD_X3D%DATA is not associated for ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END IF + CALL IO_WRITE_FIELD(TPOUTPUT%TFILE,TFIELDLIST(IDX),HFIPRI,IRESP,TFIELDLIST(IDX)%TFIELD_X3D(IMI)%DATA) + ! + !3D other types + ! + CASE DEFAULT + PRINT *,'FATAL: IO_WRITE_FIELDLIST: type not yet supported for 3D output of ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END SELECT + ! + !Other number of dimensions + ! + CASE DEFAULT + PRINT *,'FATAL: IO_WRITE_FIELDLIST: number of dimensions not yet supported for ',TRIM(TFIELDLIST(IDX)%CMNHNAME) + STOP + END SELECT +END DO +! +END SUBROUTINE IO_WRITE_FIELDLIST END MODULE MODE_FM diff --git a/src/LIB/SURCOUCHE/src/mode_io.f90 b/src/LIB/SURCOUCHE/src/mode_io.f90 index 3063554d44c44156903d6a8fca935b9d5f97d9ff..ba883102ebcb830be34d269355d2faca0b431938 100644 --- a/src/LIB/SURCOUCHE/src/mode_io.f90 +++ b/src/LIB/SURCOUCHE/src/mode_io.f90 @@ -176,7 +176,7 @@ CONTAINS CALL INITFD() - CALL INI_FIELD_LIST() +! CALL INI_FIELD_LIST() !! Default number for Processor I/O ISIOP = 1 diff --git a/src/MNH/ini_micron.f90 b/src/MNH/ini_micron.f90 index 17154b38c3ea16e6285b5a27c849bfb0fe72741d..cac673733a45722a0ab63428037098f2d2c3a969 100644 --- a/src/MNH/ini_micron.f90 +++ b/src/MNH/ini_micron.f90 @@ -106,6 +106,7 @@ USE MODD_LIMA_PRECIP_SCAVENGING_n USE MODI_INIT_AEROSOL_CONCENTRATION USE MODI_INI_LIMA USE MODI_SET_CONC_LIMA +USE MODE_FIELD ! IMPLICIT NONE ! @@ -128,6 +129,7 @@ INTEGER :: IKB,IKE REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDZ ! mesh size REAL :: ZDZMIN INTEGER :: IMI +INTEGER :: IID,IRESP ! !------------------------------------------------------------------------------- ! @@ -314,5 +316,7 @@ IMI = GET_CURRENT_MODEL_INDEX() ! XDXX,XDYY,XDZZ,XDZX,XDZY ) !END IF ! +CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X2D(IMI)%DATA=>XACPRR ! END SUBROUTINE INI_MICRO_n diff --git a/src/MNH/ini_modeln.f90 b/src/MNH/ini_modeln.f90 index deb55ee7d613200f570e53288158f3c7f523413f..9c74e2a998dfd67f1514e828e789d958e1a0e8f4 100644 --- a/src/MNH/ini_modeln.f90 +++ b/src/MNH/ini_modeln.f90 @@ -421,6 +421,7 @@ USE MODI_CH_INIT_PRODLOSSTOT_n USE MODD_CH_BUDGET_n USE MODI_CH_INIT_BUDGET_n USE MODD_CH_M9_n, ONLY:NNONZEROTERMS +USE MODE_FIELD ! USE MODE_MPPDB USE MODI_INIT_AEROSOL_PROPERTIES @@ -515,6 +516,7 @@ REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUM,DPTR_XLSVM,DPTR_XLSWM,DPTR_XLSTH REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUS,DPTR_XLSVS,DPTR_XLSWS,DPTR_XLSTHS,DPTR_XLSRVS ! INTEGER :: IIB,IJB,IIE,IJE,IDIMX,IDIMY,IMI +INTEGER :: IID ! !------------------------------------------------------------------------------- ! @@ -723,9 +725,15 @@ IF ((CUVW_ADV_SCHEME(1:3)=='CEN') .AND. (CTEMP_SCHEME == 'LEFR') ) THEN END IF ! ALLOCATE(XUT(IIU,IJU,IKU)) ; XUT = 0.0 +CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KMI)%DATA=>XUT ALLOCATE(XVT(IIU,IJU,IKU)) ; XVT = 0.0 +CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KMI)%DATA=>XVT ALLOCATE(XWT(IIU,IJU,IKU)) ; XWT = 0.0 ALLOCATE(XTHT(IIU,IJU,IKU)) ; XTHT = 0.0 +CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KMI)%DATA=>XTHT ALLOCATE(XRUS(IIU,IJU,IKU)) ; XRUS = 0.0 ALLOCATE(XRVS(IIU,IJU,IKU)) ; XRVS = 0.0 ALLOCATE(XRWS(IIU,IJU,IKU)) ; XRWS = 0.0 diff --git a/src/MNH/init_mnh.f90 b/src/MNH/init_mnh.f90 index e1ead4db5c89143430f996ff9874745859f1d741..0bcc5d53bd4e76abc133b2b496bc48219e9c6eff 100644 --- a/src/MNH/init_mnh.f90 +++ b/src/MNH/init_mnh.f90 @@ -102,6 +102,7 @@ USE MODE_MODELN_HANDLER USE MODI_READ_ALL_NAMELISTS USE MODD_MNH_SURFEX_n USE MODI_INI_SPECTRE_n +USE MODE_FIELD !JUAN USE MODE_SPLITTINGZ_ll !JUAN @@ -219,6 +220,7 @@ DO JMI=1,NMODEL ENDDO ! ! +CALL INI_FIELD_LIST() !------------------------------------------------------------------------------- ! !* 4. INITIALIZE EACH MODEL diff --git a/src/MNH/modd_fieldn.f90 b/src/MNH/modd_fieldn.f90 index 1af0368756c539a2b8aed9f11f38a2b686634de5..3c21b1d8e08fac860701ecf669f54015d23eb964 100644 --- a/src/MNH/modd_fieldn.f90 +++ b/src/MNH/modd_fieldn.f90 @@ -63,12 +63,13 @@ USE MODD_PARAMETERS, ONLY: JPMODELMAX IMPLICIT NONE TYPE FIELD_t - REAL, DIMENSION(:,:,:), POINTER :: XUT=>NULL(),XVT=>NULL(),XWT=>NULL() +! REAL, DIMENSION(:,:,:), POINTER :: XUT=>NULL(),XVT=>NULL(),XWT=>NULL() + REAL, DIMENSION(:,:,:), POINTER :: XWT=>NULL() ! U,V,W at time t REAL, DIMENSION(:,:,:), POINTER :: XRUS=>NULL(),XRVS=>NULL(),XRWS=>NULL() ! Source of (rho U), (rho V), (rho w) REAL, DIMENSION(:,:,:), POINTER :: XRUS_PRES=>NULL(),XRVS_PRES=>NULL(),XRWS_PRES=>NULL() - REAL, DIMENSION(:,:,:), POINTER :: XTHT=>NULL() ! (rho theta) at time t +! REAL, DIMENSION(:,:,:), POINTER :: XTHT=>NULL() ! (rho theta) at time t REAL, DIMENSION(:,:,:), POINTER :: XRTHS=>NULL() ! Source of (rho theta) REAL, DIMENSION(:,:,:), POINTER :: XRTHS_CLD=>NULL() ! Source of (rho theta) from resolved_cloud REAL, DIMENSION(:,:,:), POINTER :: XSUPSAT=>NULL() ! Sursat @@ -145,11 +146,22 @@ REAL, DIMENSION(:,:,:), POINTER :: XRCM=>NULL() CONTAINS SUBROUTINE FIELD_GOTO_MODEL(KFROM, KTO) +! +USE MODE_FIELD +! INTEGER, INTENT(IN) :: KFROM, KTO ! +INTEGER :: IID,IRESP +! ! Save current state for allocated arrays -FIELD_MODEL(KFROM)%XUT=>XUT -FIELD_MODEL(KFROM)%XVT=>XVT +!FIELD_MODEL(KFROM)%XUT=>XUT +!FIELD_MODEL(KFROM)%XVT=>XVT +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KFROM)%DATA=>XUT +CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KFROM)%DATA=>XVT +END IF FIELD_MODEL(KFROM)%XWT=>XWT FIELD_MODEL(KFROM)%XRUS=>XRUS FIELD_MODEL(KFROM)%XRVS=>XRVS @@ -157,7 +169,11 @@ FIELD_MODEL(KFROM)%XRWS=>XRWS FIELD_MODEL(KFROM)%XRUS_PRES=>XRUS_PRES FIELD_MODEL(KFROM)%XRVS_PRES=>XRVS_PRES FIELD_MODEL(KFROM)%XRWS_PRES=>XRWS_PRES -FIELD_MODEL(KFROM)%XTHT=>XTHT +!FIELD_MODEL(KFROM)%XTHT=>XTHT +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X3D(KFROM)%DATA=>XTHT +END IF FIELD_MODEL(KFROM)%XRTHS=>XRTHS FIELD_MODEL(KFROM)%XRTHS_CLD=>XRTHS_CLD FIELD_MODEL(KFROM)%XSUPSAT=>XSUPSAT @@ -183,8 +199,14 @@ FIELD_MODEL(KFROM)%XPABSM=>XPABSM FIELD_MODEL(KFROM)%XRCM=>XRCM ! ! Current model is set to model KTO -XUT=>FIELD_MODEL(KTO)%XUT -XVT=>FIELD_MODEL(KTO)%XVT +!XUT=>FIELD_MODEL(KTO)%XUT +!XVT=>FIELD_MODEL(KTO)%XVT +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) +XUT=>TFIELDLIST(IID)%TFIELD_X3D(KTO)%DATA +CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) +XVT=>TFIELDLIST(IID)%TFIELD_X3D(KTO)%DATA +END IF XWT=>FIELD_MODEL(KTO)%XWT XRUS=>FIELD_MODEL(KTO)%XRUS XRVS=>FIELD_MODEL(KTO)%XRVS @@ -192,7 +214,11 @@ XRWS=>FIELD_MODEL(KTO)%XRWS XRUS_PRES=>FIELD_MODEL(KTO)%XRUS_PRES XRVS_PRES=>FIELD_MODEL(KTO)%XRVS_PRES XRWS_PRES=>FIELD_MODEL(KTO)%XRWS_PRES -XTHT=>FIELD_MODEL(KTO)%XTHT +!XTHT=>FIELD_MODEL(KTO)%XTHT +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) +XTHT=>TFIELDLIST(IID)%TFIELD_X3D(KTO)%DATA +END IF XRTHS=>FIELD_MODEL(KTO)%XRTHS XRTHS_CLD=>FIELD_MODEL(KTO)%XRTHS_CLD XSUPSAT=>FIELD_MODEL(KTO)%XSUPSAT diff --git a/src/MNH/modd_precipn.f90 b/src/MNH/modd_precipn.f90 index 1a7ede313c278cc21c81c391bc24bfb3097d3462..5413147ddd5f13e1c8012ad395aced06ea39374a 100644 --- a/src/MNH/modd_precipn.f90 +++ b/src/MNH/modd_precipn.f90 @@ -49,7 +49,8 @@ TYPE PRECIP_t ! REAL, DIMENSION(:,:), POINTER :: XINPRC=>NULL(), XACPRC=>NULL(), & XINDEP=>NULL(), XACDEP=>NULL(), & - XINPRR=>NULL(), XACPRR=>NULL(), & +! XINPRR=>NULL(), XACPRR=>NULL(), & + XINPRR=>NULL(), & XINPRS=>NULL(), XACPRS=>NULL(), XINPRG=>NULL(), & XACPRG=>NULL(), XINPRH=>NULL(), XACPRH=>NULL() ! Instant and cumul of ground @@ -73,8 +74,13 @@ REAL, DIMENSION(:,:), POINTER :: XINPRC=>NULL(), XACPRC=>NULL(), & CONTAINS SUBROUTINE PRECIP_GOTO_MODEL(KFROM, KTO) +! +USE MODE_FIELD +! INTEGER, INTENT(IN) :: KFROM, KTO ! +INTEGER :: IID,IRESP +! ! Save current state for allocated arrays PRECIP_MODEL(KFROM)%XINPRC=>XINPRC PRECIP_MODEL(KFROM)%XACPRC=>XACPRC @@ -83,7 +89,11 @@ PRECIP_MODEL(KFROM)%XACDEP=>XACDEP PRECIP_MODEL(KFROM)%XINPRR=>XINPRR PRECIP_MODEL(KFROM)%XINPRR3D=>XINPRR3D PRECIP_MODEL(KFROM)%XEVAP3D=>XEVAP3D -PRECIP_MODEL(KFROM)%XACPRR=>XACPRR +!PRECIP_MODEL(KFROM)%XACPRR=>XACPRR +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) +TFIELDLIST(IID)%TFIELD_X2D(KFROM)%DATA=>XACPRR +END IF PRECIP_MODEL(KFROM)%XINPRS=>XINPRS PRECIP_MODEL(KFROM)%XACPRS=>XACPRS PRECIP_MODEL(KFROM)%XINPRG=>XINPRG @@ -99,7 +109,11 @@ XACDEP=>PRECIP_MODEL(KTO)%XACDEP XINPRR=>PRECIP_MODEL(KTO)%XINPRR XINPRR3D=>PRECIP_MODEL(KTO)%XINPRR3D XEVAP3D=>PRECIP_MODEL(KTO)%XEVAP3D -XACPRR=>PRECIP_MODEL(KTO)%XACPRR +!XACPRR=>PRECIP_MODEL(KTO)%XACPRR +IF( KFROM/=1 .AND. KTO/=1) THEN +CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) +XACPRR=>TFIELDLIST(IID)%TFIELD_X2D(KTO)%DATA +END IF XINPRS=>PRECIP_MODEL(KTO)%XINPRS XACPRS=>PRECIP_MODEL(KTO)%XACPRS XINPRG=>PRECIP_MODEL(KTO)%XINPRG diff --git a/src/MNH/modeln.f90 b/src/MNH/modeln.f90 index 4c5a4c9b2c5cdf76bd3891d054b94d39557f3620..b4225aea642024ea067f07912eaaeb4937b672cd 100644 --- a/src/MNH/modeln.f90 +++ b/src/MNH/modeln.f90 @@ -957,6 +957,8 @@ IF (IOUT < NOUT_NUMB ) THEN CALL IO_FILE_OPEN_ll(TZOUTFILE,CLUOUT,IRESP) ! CALL IO_WRITE_HEADER_NC4(TZOUTFILE,CLUOUT) + CALL IO_WRITE_FIELDLIST(TOUTPUTN(IOUT),CLUOUT) + ! CALL IO_FILE_CLOSE_ll(TZOUTFILE,CLUOUT,IRESP) ! END IF diff --git a/src/MNH/spawn_field2.f90 b/src/MNH/spawn_field2.f90 index ae8476c6482bebf149c3cde79c48fe79d8fae4ad..75e95c58b2826a3758af2fb23321a23a4467055f 100644 --- a/src/MNH/spawn_field2.f90 +++ b/src/MNH/spawn_field2.f90 @@ -195,6 +195,8 @@ USE MODD_LATZ_EDFLX USE MODD_DEF_EDDY_FLUX_n USE MODD_DEF_EDDYUV_FLUX_n ! +USE MODE_FIELD +! USE MODE_MPPDB USE MODE_ll ! @@ -240,7 +242,8 @@ INTEGER :: IRR ! Number of moist variables ! REAL, DIMENSION(SIZE(FIELD_MODEL(1)%XRT,1),SIZE(FIELD_MODEL(1)%XRT,2),SIZE(FIELD_MODEL(1)%XRT,3)) :: ZHUT ! relative humidity ! (model 1) -REAL, DIMENSION(SIZE(FIELD_MODEL(1)%XTHT,1),SIZE(FIELD_MODEL(1)%XTHT,2),SIZE(FIELD_MODEL(1)%XTHT,3)) :: ZTHVT! virtual pot. T +!REAL, DIMENSION(SIZE(FIELD_MODEL(1)%XTHT,1),SIZE(FIELD_MODEL(1)%XTHT,2),SIZE(FIELD_MODEL(1)%XTHT,3)) :: ZTHVT! virtual pot. T +REAL, DIMENSION(:,:,:),ALLOCATABLE :: ZTHVT! virtual pot. T ! (model 1) !$20140708 !$***** 3D @@ -277,6 +280,7 @@ CHARACTER (LEN=16) :: YRECFM_T ! management CHARACTER (LEN=16) :: YRECFM_M ! management CHARACTER (LEN=100) :: YCOMMENT ! variables CHARACTER (LEN=2) :: YDIR +INTEGER :: IID ! CHARACTER(LEN=2) :: INDICE INTEGER :: I @@ -296,7 +300,12 @@ CALL FMLOOK_ll(CLUOUT,CLUOUT,ILUOUT,IRESP) ! !* 1.1 Secondary variables ! -CALL COMPUTE_THV_HU(CONF_MODEL(1)%LUSERV,FIELD_MODEL(1)%XRT,FIELD_MODEL(1)%XTHT,FIELD_MODEL(1)%XPABST,ZTHVT,ZHUT) +!CALL COMPUTE_THV_HU(CONF_MODEL(1)%LUSERV,FIELD_MODEL(1)%XRT,FIELD_MODEL(1)%XTHT,FIELD_MODEL(1)%XPABST,ZTHVT,ZHUT) +CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) +ALLOCATE(ZTHVT(SIZE(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,1), & + SIZE(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,2), & + SIZE(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,3) )) +CALL COMPUTE_THV_HU(CONF_MODEL(1)%LUSERV,FIELD_MODEL(1)%XRT,TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,FIELD_MODEL(1)%XPABST,ZTHVT,ZHUT) ! !* 1.2 Working arrays for reading in SON input file ! @@ -323,15 +332,23 @@ IF (KDXRATIO == 1 .AND. KDYRATIO == 1 ) THEN ! !* 2.1.1 variables which always exist ! - PUT (:,:,:) = FIELD_MODEL(1)%XUT (KXOR:KXEND,KYOR:KYEND,:) - PVT (:,:,:) = FIELD_MODEL(1)%XVT (KXOR:KXEND,KYOR:KYEND,:) +! PUT (:,:,:) = FIELD_MODEL(1)%XUT (KXOR:KXEND,KYOR:KYEND,:) +! PVT (:,:,:) = FIELD_MODEL(1)%XVT (KXOR:KXEND,KYOR:KYEND,:) + CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) + PUT (:,:,:) = TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(KXOR:KXEND,KYOR:KYEND,:) + CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) + PVT (:,:,:) = TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(KXOR:KXEND,KYOR:KYEND,:) PWT (:,:,:) = FIELD_MODEL(1)%XWT (KXOR:KXEND,KYOR:KYEND,:) PTHVT(:,:,:) = ZTHVT(KXOR:KXEND,KYOR:KYEND,:) ! - PLSUM (:,:,:) = FIELD_MODEL(1)%XUT (KXOR:KXEND,KYOR:KYEND,:) - PLSVM (:,:,:) = FIELD_MODEL(1)%XVT (KXOR:KXEND,KYOR:KYEND,:) +! PLSUM (:,:,:) = FIELD_MODEL(1)%XUT (KXOR:KXEND,KYOR:KYEND,:) +! PLSVM (:,:,:) = FIELD_MODEL(1)%XVT (KXOR:KXEND,KYOR:KYEND,:) + PLSUM (:,:,:) = PUT (:,:,:) + PLSVM (:,:,:) = PVT (:,:,:) PLSWM (:,:,:) = FIELD_MODEL(1)%XWT (KXOR:KXEND,KYOR:KYEND,:) - PLSTHM(:,:,:) = FIELD_MODEL(1)%XTHT(KXOR:KXEND,KYOR:KYEND,:) +! PLSTHM(:,:,:) = FIELD_MODEL(1)%XTHT(KXOR:KXEND,KYOR:KYEND,:) + CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) + PLSTHM(:,:,:) = TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(KXOR:KXEND,KYOR:KYEND,:) ! PLSRVM(:,:,:) = 0. ! @@ -467,10 +484,14 @@ ELSE ! !$series of SET_LSFIELD_1WAY_ll !$***** 3D VARS - CALL SET_LSFIELD_1WAY_ll(FIELD_MODEL(1)%XUT(:,:,JI),ZUT_C(:,:,JI),2) +! CALL SET_LSFIELD_1WAY_ll(FIELD_MODEL(1)%XUT(:,:,JI),ZUT_C(:,:,JI),2) + CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) + CALL SET_LSFIELD_1WAY_ll(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(:,:,JI),ZUT_C(:,:,JI),2) CALL SET_LSFIELD_1WAY_ll(LSFIELD_MODEL(1)%XLSUM(:,:,JI), ZLSUM_C(:,:,JI),2) ! - CALL SET_LSFIELD_1WAY_ll(FIELD_MODEL(1)%XVT(:,:,JI),ZVT_C(:,:,JI),2) +! CALL SET_LSFIELD_1WAY_ll(FIELD_MODEL(1)%XVT(:,:,JI),ZVT_C(:,:,JI),2) + CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) + CALL SET_LSFIELD_1WAY_ll(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(:,:,JI),ZUT_C(:,:,JI),2) CALL SET_LSFIELD_1WAY_ll(LSFIELD_MODEL(1)%XLSVM(:,:,JI),ZLSVM_C(:,:,JI),2) ! CALL SET_LSFIELD_1WAY_ll(FIELD_MODEL(1)%XWT(:,:,JI),ZWT_C(:,:,JI),2) diff --git a/src/MNH/spawn_pressure2.f90 b/src/MNH/spawn_pressure2.f90 index afc88db334519f191b7af38171bbcce3b3e48a6f..83015a497d45b025095e22a785276ba51ce70a96 100644 --- a/src/MNH/spawn_pressure2.f90 +++ b/src/MNH/spawn_pressure2.f90 @@ -131,6 +131,8 @@ USE MODI_COMPUTE_EXNER_FROM_TOP USE MODI_COEF_VER_INTERP_LIN USE MODI_VER_INTERP_LIN ! +USE MODE_FIELD +! USE MODE_MODELN_HANDLER USE MODE_ll USE MODE_MPPDB @@ -167,7 +169,8 @@ REAL, DIMENSION(:,:,:), ALLOCATABLE :: & ! MODEL 1 VARIABLES ZTHV1, & ! virtual potential temperature at mass points at t or t-dt ZHYDEXN1, & ! hydrostatic Exner functions at mass points at t or t-dt ZSUMR ! sum of water mixing ratios (at t-dt or t) -REAL, DIMENSION(SIZE(FIELD_MODEL(1)%XTHT,1),SIZE(FIELD_MODEL(1)%XTHT,2)) :: & ! MODEL 1 VARIABLES +!REAL, DIMENSION(SIZE(FIELD_MODEL(1)%XTHT,1),SIZE(FIELD_MODEL(1)%XTHT,2)) :: & ! MODEL 1 VARIABLES +REAL, DIMENSION(:,:),ALLOCATABLE :: & ! MODEL 1 VARIABLES ZHYDEXNTOP1 ! model top Exner functions at t or t-dt !$20140709 REAL, DIMENSION(:,:), ALLOCATABLE :: ZHYDEXNTOP1_C @@ -187,6 +190,7 @@ REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWORK INTEGER :: IMI INTEGER :: JI, IDIMX_C,IDIMY_C INTEGER :: IINFO_ll +INTEGER :: IID,IRESP ! !------------------------------------------------------------------------------- ! @@ -198,8 +202,11 @@ CALL GOTO_MODEL(2) ! IIU = SIZE(PTHVT,1) IJU = SIZE(PTHVT,2) -IIU1= SIZE(FIELD_MODEL(1)%XTHT,1) -IJU1= SIZE(FIELD_MODEL(1)%XTHT,2) +!IIU1= SIZE(FIELD_MODEL(1)%XTHT,1) +!IJU1= SIZE(FIELD_MODEL(1)%XTHT,2) +CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) +IIU1= SIZE(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,1) +IJU1= SIZE(TFIELDLIST(IID)%TFIELD_X3D(1)%DATA,2) IKU=SIZE(PZZ,3) IKE=IKU-JPVEXT ! @@ -229,16 +236,20 @@ END IF ALLOCATE(ZEXN1(IIU1,IJU1,IKU)) ALLOCATE(ZTHV1(IIU1,IJU1,IKU)) ALLOCATE(ZSUMR(IIU1,IJU1,IKU)) + ALLOCATE(ZHYDEXNTOP1(IIU1,IJU1)) ZSUMR(:,:,:) = 0. DO JRR=1,CONF_MODEL(1)%NRR ZSUMR(:,:,:) = ZSUMR(:,:,:) + FIELD_MODEL(1)%XRT(:,:,:,JRR) END DO ! ZEXN1(:,:,:)=(FIELD_MODEL(1)%XPABST(:,:,:)/XP00)**(XRD/XCPD) + CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) IF (CONF_MODEL(1)%LUSERV) THEN - ZTHV1(:,:,:)=FIELD_MODEL(1)%XTHT(:,:,:)*(1.+XRV/XRD*FIELD_MODEL(1)%XRT(:,:,:,1))/(1.+ZSUMR) +! ZTHV1(:,:,:)=FIELD_MODEL(1)%XTHT(:,:,:)*(1.+XRV/XRD*FIELD_MODEL(1)%XRT(:,:,:,1))/(1.+ZSUMR) + ZTHV1(:,:,:)=TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(:,:,:)*(1.+XRV/XRD*FIELD_MODEL(1)%XRT(:,:,:,1))/(1.+ZSUMR) ELSE - ZTHV1(:,:,:)=FIELD_MODEL(1)%XTHT(:,:,:) +! ZTHV1(:,:,:)=FIELD_MODEL(1)%XTHT(:,:,:) + ZTHV1(:,:,:)=TFIELDLIST(IID)%TFIELD_X3D(1)%DATA(:,:,:) END IF DEALLOCATE(ZSUMR) ! diff --git a/src/MNH/spawn_surf2_rain.f90 b/src/MNH/spawn_surf2_rain.f90 index 90f2a47c7832dfc9088727711dfe2a2ec8387398..5ea40207d2727dc6adc2e5a6cc4903450ab0553b 100644 --- a/src/MNH/spawn_surf2_rain.f90 +++ b/src/MNH/spawn_surf2_rain.f90 @@ -128,6 +128,8 @@ USE MODE_MODELN_HANDLER ! USE MODI_READ_PRECIP_FIELD ! +USE MODE_FIELD +! ! IMPLICIT NONE ! @@ -178,6 +180,7 @@ CHARACTER (LEN=4):: YGETRCT,YGETRRT,YGETRST,YGETRGT,YGETRHT ! READ,INIT or SKIP INTEGER :: ILU ! vertical size of arrays ! INTEGER :: IDIMX,IDIMY +INTEGER :: IID,IRESP !------------------------------------------------------------------------------- ! !* 1. PROLOGUE: @@ -216,7 +219,9 @@ IF (KDXRATIO == 1 .AND. KDYRATIO == 1 ) THEN PINPRR(:,:) = PRECIP_MODEL(1)%XINPRR(KXOR:KXEND,KYOR:KYEND) PINPRR3D(:,:,:) = PRECIP_MODEL(1)%XINPRR3D(KXOR:KXEND,KYOR:KYEND,:) PEVAP3D(:,:,:) = PRECIP_MODEL(1)%XEVAP3D(KXOR:KXEND,KYOR:KYEND,:) - PACPRR(:,:) = PRECIP_MODEL(1)%XACPRR(KXOR:KXEND,KYOR:KYEND) +! PACPRR(:,:) = PRECIP_MODEL(1)%XACPRR(KXOR:KXEND,KYOR:KYEND) + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) + PACPRR(:,:) = TFIELDLIST(IID)%TFIELD_X2D(1)%DATA(KXOR:KXEND,KYOR:KYEND) END IF ! IF (SIZE(PRECIP_MODEL(1)%XINPRS) /= 0 ) THEN @@ -292,10 +297,12 @@ ELSE XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, & 2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1, & LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XEVAP3D,PEVAP3D) + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) CALL BIKHARDT(XBMX1,XBMX2,XBMX3,XBMX4,XBMY1,XBMY2,XBMY3,XBMY4, & XBFX1,XBFX2,XBFX3,XBFX4,XBFY1,XBFY2,XBFY3,XBFY4, & 2,2,IDIMX-1,IDIMY-1,KDXRATIO,KDYRATIO,1, & - LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRR,PACPRR) +! LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,PRECIP_MODEL(1)%XACPRR,PACPRR) + LBC_MODEL(1)%CLBCX,LBC_MODEL(1)%CLBCY,TFIELDLIST(IID)%TFIELD_X2D(1)%DATA,PACPRR) PINPRR(:,:)=MAX(0.,PINPRR(:,:)) PINPRR3D(:,:,:)=MAX(0.,PINPRR3D(:,:,:)) PEVAP3D(:,:,:)=MAX(0.,PEVAP3D(:,:,:)) diff --git a/src/MNH/write_lfin.f90 b/src/MNH/write_lfin.f90 index 67f406f17a48ef77b2ae58e5224d2dfa6c535a57..7f3dddc992da9e76080001f0835ecc5a67c2f327 100644 --- a/src/MNH/write_lfin.f90 +++ b/src/MNH/write_lfin.f90 @@ -640,11 +640,7 @@ CALL MPPDB_CHECK3D(XUT,"write_lfifmn after IO_WRITE_FIELD::XUT",PRECISION) !20131128 check XVT-> X_Y_W_V wind component for PRC CALL MPPDB_CHECK3D(XVT,"write_lfifmn::XVT",PRECISION) ! -YRECFM='VT' -YCOMMENT='X_Y_Z_V component of wind (m/s)' -IGRID=3 -ILENCH=LEN(YCOMMENT) -CALL FMWRIT(YFMFILE,YRECFM,CLUOUT,YDIR,XVT,IGRID,ILENCH,YCOMMENT,IRESP) +CALL IO_WRITE_FIELD(TPFILE,'VT',CLUOUT,IRESP,XVT) ! YRECFM='WT' YCOMMENT='X_Y_Z_vertical wind (m/s)' @@ -652,11 +648,7 @@ IGRID=4 ILENCH=LEN(YCOMMENT) CALL FMWRIT(YFMFILE,YRECFM,CLUOUT,YDIR,XWT,IGRID,ILENCH,YCOMMENT,IRESP) ! -YRECFM='THT' -YCOMMENT='X_Y_Z_potential temperature (K)' -IGRID=1 -ILENCH=LEN(YCOMMENT) -CALL FMWRIT(YFMFILE,YRECFM,CLUOUT,YDIR,XTHT,IGRID,ILENCH,YCOMMENT,IRESP) +CALL IO_WRITE_FIELD(TPFILE,'THT',CLUOUT,IRESP,XTHT) ! !* 1.4.2 Time t-dt: