diff --git a/src/MNH/compare_dad.f90 b/src/MNH/compare_dad.f90 index 675afaa560ad42a72a26cea2156a4b4c465970fa..b3a92a527d4f4d02073d99da03601909eca42a05 100644 --- a/src/MNH/compare_dad.f90 +++ b/src/MNH/compare_dad.f90 @@ -74,6 +74,7 @@ USE MODD_IO_ll, ONLY: TFILEDATA USE MODD_LUNIT_n USE MODD_PARAMETERS, ONLY: JPHEXT,JPVEXT,NMNHNAMELGTMAX ! +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_FM USE MODE_FMREAD USE MODE_GRIDPROJ @@ -92,6 +93,7 @@ INTEGER, INTENT(OUT) :: KRESP !* 0.2 Declarations of local variables : ! ! +INTEGER :: IID INTEGER :: IRESP ! Return codes in FM routines INTEGER :: ILUOUT ! Logical unit number for the output listing INTEGER :: IMASDEV @@ -111,6 +113,7 @@ INTEGER :: IIMAX_1,IJMAX_1,IKMAX_1 INTEGER :: IIMAX_2,IJMAX_2,IKMAX_2 ! REAL :: ZLATORI, ZLONORI, ZXHATM, ZYHATM +TYPE(TFIELDDATA) :: TZFIELD TYPE(TFILEDATA),POINTER :: TZDADINIFILE => NULL() TYPE(TFILEDATA),POINTER :: TZDADSPAFILE => NULL() !------------------------------------------------------------------------------- @@ -171,8 +174,16 @@ IF (.NOT.LCARTESIAN) THEN CALL IO_READ_FIELD(TZDADINIFILE,'MASDEV',IMASDEV) ! IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TZDADINIFILE,'LATOR',ZLATORI_1) - CALL IO_READ_FIELD(TZDADINIFILE,'LONOR',ZLONORI_1) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TZDADINIFILE,TZFIELD,ZLONORI_1) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TZDADINIFILE,TZFIELD,ZLATORI_1) + ! ZXHATM = - 0.5 * (ZXHAT_1(1)+ZXHAT_1(2)) ZYHATM = - 0.5 * (ZYHAT_1(1)+ZYHAT_1(2)) CALL SM_LATLON(ZLATORI_1,ZLONORI_1,ZXHATM,ZYHATM,ZLATORI,ZLONORI) @@ -220,8 +231,16 @@ IF (.NOT.LCARTESIAN) THEN CALL IO_READ_FIELD(TZDADSPAFILE,'MASDEV',IMASDEV) ! IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TZDADSPAFILE,'LATOR',ZLATORI_2) - CALL IO_READ_FIELD(TZDADSPAFILE,'LONOR',ZLONORI_2) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TZDADSPAFILE,TZFIELD,ZLONORI_2) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TZDADSPAFILE,TZFIELD,ZLATORI_2) + ! ZXHATM = - 0.5 * (ZXHAT_2(1)+ZXHAT_2(2)) ZYHATM = - 0.5 * (ZYHAT_2(1)+ZYHAT_2(2)) CALL SM_LATLON(ZLATORI_2,ZLONORI_2,ZXHATM,ZYHATM,ZLATORI,ZLONORI) diff --git a/src/MNH/ini_size_spawn.f90 b/src/MNH/ini_size_spawn.f90 index 428835f2d242d828338e3773ec7591f7c0cacb0f..16a074809ca5f92fdbed8e5be534a63a1a92a096 100644 --- a/src/MNH/ini_size_spawn.f90 +++ b/src/MNH/ini_size_spawn.f90 @@ -91,6 +91,7 @@ USE MODD_SPAWN USE MODD_VAR_ll, ONLY : YSPLITTING ! USE MODE_ll +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_FM USE MODE_FMREAD USE MODE_GRIDPROJ @@ -125,7 +126,7 @@ CHARACTER (LEN=5) :: YPRESOPT ! Pressure solver option of model 1 INTEGER :: IITR ! Iterations of pressure solver of model 1 CHARACTER (LEN=28) :: YMY_NAME, YDAD_NAME CHARACTER (LEN=2) :: YSTORAGE_TYPE -INTEGER :: IMI +INTEGER :: IID, IMI ! !$20140602 INTEGER :: IIU, IJU @@ -139,6 +140,7 @@ INTEGER :: IDIMX, IDIMY, IIB, IJB, IIE, IJE !$ REAL :: ZLATOR, ZLONOR, ZXHATM, ZYHATM INTEGER :: IIMAX_ll,IJMAX_ll +TYPE(TFIELDDATA) :: TZFIELD TYPE(TFILEDATA),POINTER :: TZDOMAIN => NULL() ! ! @@ -275,8 +277,16 @@ IF (LEN_TRIM(CDOMAIN)>0) THEN CALL IO_READ_FIELD(TPINIFILE,'MASDEV',IMASDEV) ! IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TZDOMAIN,'LATOR',XPGDLATOR) - CALL IO_READ_FIELD(TZDOMAIN,'LONOR',XPGDLONOR) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,XPGDLONOR) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,XPGDLATOR) + ! ZXHATM = - 0.5 * (XPGDXHAT(1)+XPGDXHAT(2)) ZYHATM = - 0.5 * (XPGDYHAT(1)+XPGDYHAT(2)) CALL SM_LATLON(XPGDLATOR,XPGDLONOR,ZXHATM,ZYHATM,ZLATOR,ZLONOR) diff --git a/src/MNH/init_for_convlfi.f90 b/src/MNH/init_for_convlfi.f90 index 9e748d4cc607f17d7dec635d44998c6251565e9d..73ff69a90a49a066a83baccf5a34ebee60669284 100644 --- a/src/MNH/init_for_convlfi.f90 +++ b/src/MNH/init_for_convlfi.f90 @@ -84,6 +84,7 @@ USE MODD_TIME USE MODD_TIME_n USE MODD_VAR_ll, ONLY : NPROC ! +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_TIME USE MODE_GRIDPROJ USE MODE_GRIDCART @@ -123,6 +124,8 @@ INTEGER :: IIU,IJU ! Upper dimension in x,y direction (local) INTEGER :: IKU ! Upper dimension in z direction INTEGER :: IINFO_ll ! return code of // routines INTEGER :: IMASDEV ! masdev of the file +INTEGER :: IID +TYPE(TFIELDDATA) :: TZFIELD ! !------------------------------------------------------------------------------- ! @@ -202,8 +205,16 @@ IF (.NOT.LCARTESIAN) THEN CALL IO_READ_FIELD(TPINIFILE,'LATORI',XLATORI) ! IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TPINIFILE,'LONOR',XLONORI) - CALL IO_READ_FIELD(TPINIFILE,'LATOR',XLATORI) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,XLONORI) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,XLATORI) + ! ALLOCATE(ZXHAT_ll(NIMAX_ll+ 2 * JPHEXT),ZYHAT_ll(NJMAX_ll+2 * JPHEXT)) CALL GATHERALL_FIELD_ll('XX',XXHAT,ZXHAT_ll,IRESP) !// CALL GATHERALL_FIELD_ll('YY',XYHAT,ZYHAT_ll,IRESP) !// diff --git a/src/MNH/read_field.f90 b/src/MNH/read_field.f90 index d2bd7fa30fe3f81ccbab3c7e043fe4175a5d0c59..467b1bdba73d0143596bb0ca7c54b1179bac44a3 100644 --- a/src/MNH/read_field.f90 +++ b/src/MNH/read_field.f90 @@ -268,7 +268,7 @@ USE MODD_RAIN_C2R2_DESCR, ONLY: C2R2NAMES USE MODD_SALT USE MODD_TIME ! for type DATE_TIME ! -USE MODE_FIELD, ONLY: TFIELDDATA,TYPEDATE,TYPEREAL +USE MODE_FIELD, ONLY: TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME,TYPEDATE,TYPEREAL USE MODE_FM USE MODE_FMREAD USE MODE_IO_ll, ONLY: UPCASE @@ -375,7 +375,7 @@ REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS_CLD, PRSVS_CLD ! !* 0.2 declarations of local variables ! -INTEGER :: I +INTEGER :: I, IID INTEGER :: ILUOUT ! Unit number for prints INTEGER :: IRESP INTEGER :: ISV ! total number of scalar variables @@ -405,11 +405,30 @@ ZWORK = 0.0 !* 2.1 Time t: ! IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'UM',PUT) - CALL IO_READ_FIELD(TPINIFILE,'VM',PVT) - CALL IO_READ_FIELD(TPINIFILE,'WM',PWT) - CALL IO_READ_FIELD(TPINIFILE,'THM',PTHT) - CALL IO_READ_FIELD(TPINIFILE,'PABSM',PPABST) + CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'UM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PUT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'VM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PVT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('WT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'WM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PWT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'THM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PTHT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('PABST',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'PABSM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PPABST) ELSE CALL IO_READ_FIELD(TPINIFILE,'UT',PUT) CALL IO_READ_FIELD(TPINIFILE,'VT',PVT) @@ -421,7 +440,10 @@ ENDIF SELECT CASE(HGETTKET) CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'TKEM',PTKET) + CALL FIND_FIELD_ID_FROM_MNHNAME('TKET',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'TKEM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PTKET) ELSE CALL IO_READ_FIELD(TPINIFILE,'TKET',PTKET) END IF @@ -436,7 +458,10 @@ END SELECT SELECT CASE(HGETRVT) ! vapor CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RVM',PRT(:,:,:,IDX_RVT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RVT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RVM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RVT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RVT',PRT(:,:,:,IDX_RVT)) END IF @@ -447,7 +472,10 @@ END SELECT SELECT CASE(HGETRCT) ! cloud CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RCM',PRT(:,:,:,IDX_RCT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RCT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RCM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RCT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RCT',PRT(:,:,:,IDX_RCT)) END IF @@ -458,7 +486,10 @@ END SELECT SELECT CASE(HGETRRT) ! rain CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RRM',PRT(:,:,:,IDX_RRT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RRT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RRM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RRT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RRT',PRT(:,:,:,IDX_RRT)) END IF @@ -469,7 +500,10 @@ END SELECT SELECT CASE(HGETRIT) ! cloud ice CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RIM',PRT(:,:,:,IDX_RIT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RIT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RIM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RIT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RIT',PRT(:,:,:,IDX_RIT)) END IF @@ -480,7 +514,10 @@ END SELECT SELECT CASE(HGETRST) ! snow CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RSM',PRT(:,:,:,IDX_RST)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RST',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RSM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RST)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RST',PRT(:,:,:,IDX_RST)) END IF @@ -491,7 +528,10 @@ END SELECT SELECT CASE(HGETRGT) ! graupel CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RGM',PRT(:,:,:,IDX_RGT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RGT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RGM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RGT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RGT',PRT(:,:,:,IDX_RGT)) END IF @@ -502,7 +542,10 @@ END SELECT SELECT CASE(HGETRHT) ! hail CASE('READ') IF (KMASDEV<50) THEN - CALL IO_READ_FIELD(TPINIFILE,'RHM',PRT(:,:,:,IDX_RHT)) + CALL FIND_FIELD_ID_FROM_MNHNAME('RHT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RHM' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RHT)) ELSE CALL IO_READ_FIELD(TPINIFILE,'RHT',PRT(:,:,:,IDX_RHT)) END IF diff --git a/src/MNH/read_hgrid.f90 b/src/MNH/read_hgrid.f90 index 8c8ae603e72da7ce6363602efc88bc17003c4ed1..fa859bb0a8a4e718fdbfaf94eaf3f5048e94053c 100644 --- a/src/MNH/read_hgrid.f90 +++ b/src/MNH/read_hgrid.f90 @@ -93,6 +93,7 @@ USE MODD_PARAMETERS USE MODD_PGDDIM USE MODD_PGDGRID ! +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_FMREAD USE MODE_GRIDPROJ USE MODE_IO_ll @@ -115,11 +116,11 @@ CHARACTER(LEN=2) , INTENT(OUT) :: HSTORAGE_TYPE ! INTEGER :: IRESP INTEGER :: IMASDEV -INTEGER :: IMI +INTEGER :: IID, IMI LOGICAL :: G1D,G2D,GPACK INTEGER :: IINFO_ll -!------------------------------------------------------------------------------- -REAL :: ZLATOR, ZLONOR, ZXHATM, ZYHATM +REAL :: ZLATOR, ZLONOR, ZXHATM, ZYHATM +TYPE(TFIELDDATA) :: TZFIELD !------------------------------------------------------------------------------- ! !* 1. TEST ON MODEL INDEX @@ -199,8 +200,16 @@ IF (IRESP/=0) GPACK=.TRUE. CALL SET_FMPACK_ll(G1D,G2D,GPACK) !------------------------------------------------------------------------------- IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TPFMFILE,'LATOR',XPGDLATOR) - CALL IO_READ_FIELD(TPFMFILE,'LONOR',XPGDLONOR) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPFMFILE,TZFIELD,XPGDLONOR) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPFMFILE,TZFIELD,XPGDLATOR) + ! ZXHATM = - 0.5 * (XPGDXHAT(1)+XPGDXHAT(2)) ZYHATM = - 0.5 * (XPGDYHAT(1)+XPGDYHAT(2)) CALL SM_LATLON(XPGDLATOR,XPGDLONOR,ZXHATM,ZYHATM,ZLATOR,ZLONOR) diff --git a/src/MNH/read_hgridn.f90 b/src/MNH/read_hgridn.f90 index 983d599e086a400a8a36d63712dc135e41a47847..2d7685f0cbf5259cc2f0f24517cca8ea3f315a26 100644 --- a/src/MNH/read_hgridn.f90 +++ b/src/MNH/read_hgridn.f90 @@ -89,6 +89,7 @@ USE MODD_IO_ll, ONLY: TFILEDATA USE MODD_LUNIT_n USE MODD_PARAMETERS, ONLY : JPHEXT, JPVEXT, JPMODELMAX ! +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_FM USE MODE_FMREAD USE MODE_GRIDPROJ @@ -111,7 +112,7 @@ INTEGER :: IRESP REAL :: ZLAT0,ZLON0,ZRPK,ZBETA REAL :: ZEPS = 1.E-10 INTEGER :: IMASDEV -INTEGER :: IMI +INTEGER :: IID, IMI ! !------------------------------------------------------------------------------- REAL :: ZLATOR, ZLONOR, ZXHATM, ZYHATM @@ -121,6 +122,7 @@ INTEGER :: IIU,IJU !JUAN REALZ INTEGER :: IXOR, IYOR, IXEND, IYEND INTEGER :: IJPHEXT +TYPE(TFIELDDATA) :: TZFIELD ! CALL FMLOOK_ll(CLUOUT,CLUOUT,ILUOUT,IRESP) ! @@ -284,8 +286,16 @@ END IF ! !------------------------------------------------------------------------------- IF (IMASDEV<=45) THEN - CALL IO_READ_FIELD(TPFMFILE,'LATOR',XLATORI) - CALL IO_READ_FIELD(TPFMFILE,'LONOR',XLONORI) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPFMFILE,TZFIELD,XLONORI) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPFMFILE,TZFIELD,XLATORI) + ! ZXHATM = - 0.5 * (XXHAT(1)+XXHAT(2)) ZYHATM = - 0.5 * (XYHAT(1)+XYHAT(2)) CALL SM_LATLON(XLATORI,XLONORI,ZXHATM,ZYHATM,ZLATOR,ZLONOR) diff --git a/src/MNH/read_surf_mnh.f90 b/src/MNH/read_surf_mnh.f90 index 2234becb3c65a3ab75541f8c9c98f5a5899e5394..64c407fb486e72fad5ba4004d0418da636c284ce 100644 --- a/src/MNH/read_surf_mnh.f90 +++ b/src/MNH/read_surf_mnh.f90 @@ -48,7 +48,7 @@ USE MODD_CONF, ONLY : CPROGRAM USE MODD_GRID, ONLY: XRPK,XBETA,XLAT0,XLON0 USE MODD_PARAMETERS, ONLY: JPHEXT, XUNDEF ! -USE MODE_FIELD, ONLY : TFIELDDATA,TYPEREAL +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME,TYPEREAL USE MODE_FM USE MODE_FMREAD USE MODE_GRIDPROJ @@ -73,7 +73,7 @@ INTEGER :: IGRID ! IGRID : grid indicator INTEGER :: ILENCH ! ILENCH : length of comment string INTEGER :: IMASDEV -INTEGER :: IRESP +INTEGER :: IID,IRESP INTEGER :: IIMAX,IJMAX REAL,DIMENSION(:), ALLOCATABLE :: ZXHAT,ZYHAT REAL :: ZLATOR,ZLONOR,ZXHATM,ZYHATM,ZLATORI,ZLONORI @@ -105,8 +105,17 @@ IF (HREC=='LONORI' .OR. HREC=='LATORI') THEN ALLOCATE(ZXHAT(IIMAX+2*JPHEXT),ZYHAT(IJMAX+2*JPHEXT)) CALL IO_READ_FIELD(TPINFILE,'XHAT',ZXHAT) CALL IO_READ_FIELD(TPINFILE,'YHAT',ZYHAT) - CALL IO_READ_FIELD(TPINFILE,'LATOR',ZLATOR) - CALL IO_READ_FIELD(TPINFILE,'LONOR',ZLONOR) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPINFILE,TZFIELD,ZLONOR) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPINFILE,TZFIELD,ZLATOR) + ! ZXHATM = - 0.5 * (ZXHAT(1)+ZXHAT(2)) ZYHATM = - 0.5 * (ZYHAT(1)+ZYHAT(2)) DEALLOCATE(ZXHAT,ZYHAT) diff --git a/src/MNH/set_grid.f90 b/src/MNH/set_grid.f90 index 93c40d04ca426254589a954965fa16a5d51253f6..ff16adde4c6f101263572c158bb9ef9a6b64ef37 100644 --- a/src/MNH/set_grid.f90 +++ b/src/MNH/set_grid.f90 @@ -254,6 +254,7 @@ USE MODE_TIME USE MODE_ll USE MODI_GATHER_ll !!!! a mettre dans mode_ll ! +USE MODE_FIELD, ONLY : TFIELDDATA,TFIELDLIST,FIND_FIELD_ID_FROM_MNHNAME USE MODE_FMREAD USE MODD_OUT_n, ONLY : OUT_MODEL USE MODE_IO_MANAGE_STRUCT @@ -333,7 +334,7 @@ REAL, DIMENSION(:), ALLOCATABLE :: ZYHAT_ll ! Position y in the conformal ! plane (array on the complete domain) REAL :: ZXHATM,ZYHATM ! coordinates of mass point REAL :: ZLATORI, ZLONORI ! lat and lon of left-bottom point -INTEGER :: IRESP +INTEGER :: IID,IRESP CHARACTER (LEN=40) :: YTITLE ! Title for date print INTEGER :: ILUOUT ! Logical unit number for ! output-listing @@ -342,6 +343,7 @@ INTEGER :: IIUP,IJUP ,ISUP=1 ! size of working ! supp. time steps ! INTEGER :: IMASDEV ! masdev of the file +TYPE(TFIELDDATA) :: TZFIELD !------------------------------------------------------------------------------- ! CALL IO_READ_FIELD(TPINIFILE,'MASDEV',IMASDEV) @@ -379,8 +381,16 @@ IF (.NOT.LCARTESIAN) THEN CALL IO_READ_FIELD(TPINIFILE,'LATORI',PLATORI) ! ELSE - CALL IO_READ_FIELD(TPINIFILE,'LONOR',PLONORI) - CALL IO_READ_FIELD(TPINIFILE,'LATOR',PLATORI) + CALL FIND_FIELD_ID_FROM_MNHNAME('LONORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LONOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PLONORI) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('LATORI',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'LATOR' + CALL IO_READ_FIELD(TPINIFILE,TZFIELD,PLATORI) + ! ALLOCATE(ZXHAT_ll(KIMAX_ll+ 2 * JPHEXT),ZYHAT_ll(KJMAX_ll+2 * JPHEXT)) CALL GATHERALL_FIELD_ll('XX',PXHAT,ZXHAT_ll,IRESP) !// CALL GATHERALL_FIELD_ll('YY',PYHAT,ZYHAT_ll,IRESP) !//