diff --git a/src/MNH/ini_aircraft.f90 b/src/MNH/ini_aircraft.f90 index 2b151c7edababad5de65f874a19b453a4a93558e..90beb1354dca150ada71e2b156dfdd2a2907ef1d 100644 --- a/src/MNH/ini_aircraft.f90 +++ b/src/MNH/ini_aircraft.f90 @@ -45,7 +45,7 @@ CONTAINS !! !! 3) the type of aircraft !! -!! 'AIRCRA' for aircraft +!! 'AIRCRAFT' for aircraft !! !! 4) the takeoff date and time !! diff --git a/src/MNH/modd_aircraft_balloon.f90 b/src/MNH/modd_aircraft_balloon.f90 index 90c80cd3be48ed6e70dadd2e395763af83f5a223..60cc53139a13d928a01c4ccde683070a6a137620 100644 --- a/src/MNH/modd_aircraft_balloon.f90 +++ b/src/MNH/modd_aircraft_balloon.f90 @@ -64,11 +64,6 @@ INTEGER, PARAMETER :: NFLYER_DEFAULT_RANK = 1 INTEGER, PRIVATE, PARAMETER :: NMODEL_FIX = 1 INTEGER, PRIVATE, PARAMETER :: NMODEL_MOB = 2 -INTEGER, PRIVATE, PARAMETER :: NTYPE_AIRCRA = 0 -INTEGER, PRIVATE, PARAMETER :: NTYPE_CVBALL = 1 -INTEGER, PRIVATE, PARAMETER :: NTYPE_ISODEN = 2 -INTEGER, PRIVATE, PARAMETER :: NTYPE_RADIOS = 4 - LOGICAL :: LFLYER = .FALSE. ! flag to use aircraft/balloons ! ############################################ @@ -82,11 +77,6 @@ TYPE, EXTENDS(TSENSOR), ABSTRACT :: TFLYERDATA ! 'MOB' : change od model depends of the ! balloon/aircraft location INTEGER :: NMODEL = 0 ! model number for each balloon/aircraft (may change if CMODEL='MOB') - CHARACTER(LEN=6) :: CTYPE = '' ! flyer type: - ! 'RADIOS' : radiosounding balloon - ! 'ISODEN' : iso-density balloon - ! 'AIRCRA' : aircraft - ! 'CVBALL' : Constant Volume balloon TYPE(DATE_TIME) :: TLAUNCH = TPREFERENCE_DATE ! launch/takeoff date and time LOGICAL :: LCRASH = .FALSE. ! occurence of crash INTEGER :: NCRASH = NCRASH_NO @@ -299,7 +289,7 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_FLYER( TPSENSOR, KSTORE ) ALLOCATE( TPSENSOR%XSVW_FLUX(ISTORE, NSV) ) IVARSIZE = IVARSIZE + 2 + NSV - TPSENSOR%NBUFFER_FIXSIZE = TPSENSOR%NBUFFER_FIXSIZE + 9 + 2 + TPSENSOR%NBUFFER_FIXSIZE = TPSENSOR%NBUFFER_FIXSIZE + 9 + 1 TPSENSOR%NBUFFER_VARSIZE = TPSENSOR%NBUFFER_VARSIZE + IVARSIZE TPSENSOR%NMODELHIST = NNEGUNDEF @@ -488,20 +478,6 @@ SUBROUTINE BUFFER_PACK_FLYER( TPSENSOR, PBUFFER, KPOS, KSTORE_CURRENT ) PBUFFER(KPOS) = TPSENSOR%NMODEL ; KPOS = KPOS + 1 - SELECT CASE( TPSENSOR%CTYPE ) - CASE( 'AIRCRA' ) - PBUFFER(KPOS) = NTYPE_AIRCRA - CASE( 'CVBALL' ) - PBUFFER(KPOS) = NTYPE_CVBALL - CASE( 'ISODEN' ) - PBUFFER(KPOS) = NTYPE_ISODEN - CASE( 'RADIOS' ) - PBUFFER(KPOS) = NTYPE_RADIOS - CASE DEFAULT - CALL PRINT_MSG( NVERB_FATAL, 'FLYER_SEND', 'invalid CTYPE for flyer' ) - END SELECT - KPOS = KPOS + 1 - PBUFFER(KPOS) = TPSENSOR%TLAUNCH - TPREFERENCE_DATE ; KPOS = KPOS + 1 IF ( TPSENSOR%LCRASH ) THEN @@ -720,20 +696,6 @@ SUBROUTINE BUFFER_UNPACK_FLYER( TPSENSOR, PBUFFER, KPOS, KSTORE ) TPSENSOR%NMODEL = NINT( PBUFFER(KPOS) ); KPOS = KPOS + 1 - SELECT CASE( NINT( PBUFFER(KPOS) ) ) - CASE( NTYPE_AIRCRA ) - TPSENSOR%CTYPE = 'AIRCRA' - CASE( NTYPE_CVBALL ) - TPSENSOR%CTYPE = 'CVBALL' - CASE( NTYPE_ISODEN ) - TPSENSOR%CTYPE = 'ISODEN' - CASE( NTYPE_RADIOS ) - TPSENSOR%CTYPE = 'RADIOS' - CASE DEFAULT - CALL PRINT_MSG( NVERB_FATAL, 'FLYER_RECV_AND_ALLOCATE', 'invalid CTYPE for flyer' ) - END SELECT - KPOS = KPOS + 1 - TPSENSOR%TLAUNCH = TPREFERENCE_DATE + PBUFFER(KPOS); KPOS = KPOS + 1 IF ( NINT( PBUFFER(KPOS) ) == 0 ) THEN diff --git a/src/MNH/modd_sensor.f90 b/src/MNH/modd_sensor.f90 index be067278812b9eb900b9d15be9d0280ef0f9a89c..4710e232db0755051b61d373b717b76c7944e9fa 100644 --- a/src/MNH/modd_sensor.f90 +++ b/src/MNH/modd_sensor.f90 @@ -32,12 +32,16 @@ MODULE MODD_SENSOR TYPE, ABSTRACT :: TSENSOR CHARACTER(LEN=NSENSORNAMELGTMAX) :: CNAME = '' ! Title or name of the sensor + CHARACTER(LEN=NSENSORNAMELGTMAX) :: CTYPE = '' ! Sensor type: + ! 'AIRCRAFT' : aircraft + ! 'RADIOS' : radiosounding balloon, 'ISODEN' : iso-density balloon, 'CVBALL' : Constant Volume balloon + ! 'STATION', 'PROFILER',... INTEGER :: NID = 0 ! Identification number of the sensor (from 1 to total number, ! separate numbering for separate sensor types) INTEGER :: NSTORE_CUR = 0 ! Current store instant INTEGER :: NSTORE_MAX = -1 ! Maximum number of store instants (negative if arrays not allocated) - INTEGER :: NBUFFER_FIXSIZE = 43 + NSENSORNAMELGTMAX ! Memory size required for exchange buffer (fixed part) + INTEGER :: NBUFFER_FIXSIZE = 43 + 2 * NSENSORNAMELGTMAX ! Memory size required for exchange buffer (fixed part) INTEGER :: NBUFFER_VARSIZE = 0 ! Memory size required for exchange buffer (part per store instant) LOGICAL :: LFIX ! true if sensor is fix (can not move) @@ -897,6 +901,11 @@ MODULE MODD_SENSOR KPOS = KPOS + 1 END DO + DO JI = 1, LEN( TPSENSOR%CTYPE ) + PBUFFER(KPOS) = ICHAR( TPSENSOR%CTYPE(JI:JI) ) + KPOS = KPOS + 1 + END DO + PBUFFER(KPOS) = TPSENSOR%NID ; KPOS = KPOS + 1 PBUFFER(KPOS) = TPSENSOR%NSTORE_CUR ; KPOS = KPOS + 1 PBUFFER(KPOS) = TPSENSOR%NSTORE_MAX ; KPOS = KPOS + 1 @@ -1009,6 +1018,11 @@ MODULE MODD_SENSOR KPOS = KPOS + 1 END DO + DO JI = 1, LEN( TPSENSOR%CTYPE ) + TPSENSOR%CTYPE(JI:JI) = ACHAR( NINT( PBUFFER(KPOS) ) ) + KPOS = KPOS + 1 + END DO + TPSENSOR%NID = NINT( PBUFFER(KPOS) ) ; KPOS = KPOS + 1 TPSENSOR%NSTORE_CUR = NINT( PBUFFER(KPOS) ) ; KPOS = KPOS + 1 TPSENSOR%NSTORE_MAX = NINT( PBUFFER(KPOS) ) ; KPOS = KPOS + 1 diff --git a/src/MNH/modd_type_statprof.f90 b/src/MNH/modd_type_statprof.f90 index a5c12fc88d80e032a8e87163105129ee42134148..b7970e769fad6b4bd921d8d476e73eb16355bd8c 100644 --- a/src/MNH/modd_type_statprof.f90 +++ b/src/MNH/modd_type_statprof.f90 @@ -102,7 +102,6 @@ TYPE, EXTENDS( TSTATPROFDATA ) :: TSTATIONDATA TYPE, EXTENDS( TSTATPROFDATA ) :: TPROFILERDATA ! Type to store all the data of 1 profiler - CHARACTER(LEN=NSENSORNAMELGTMAX) :: CTYPE = '' ! Profiler type ! (n: recording instants) REAL, DIMENSION(:,:), ALLOCATABLE :: XFF ! wind intensity @@ -339,7 +338,7 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_PROFILER( TPSENSOR, KSTORE ) ALLOCATE( TPSENSOR%XTKE_DISS(IKU, KSTORE) ) ; IVARSIZE = IVARSIZE + IKU - TPSENSOR%NBUFFER_FIXSIZE = TPSENSOR%NBUFFER_FIXSIZE + LEN( TPSENSOR%CTYPE ) + TPSENSOR%NBUFFER_FIXSIZE = TPSENSOR%NBUFFER_FIXSIZE TPSENSOR%NBUFFER_VARSIZE = TPSENSOR%NBUFFER_VARSIZE + IVARSIZE TPSENSOR%XFF (:,:) = XUNDEF @@ -523,12 +522,6 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_PROFILER( TPSENSOR, KSTORE ) CALL TPSENSOR%BUFFER_PACK_STATPROF( PBUFFER, KPOS, ISTORES ) - ! Convert characters to integers - DO JI = 1, LEN(tpsensor%Ctype) - pbuffer(kpos) = ICHAR( tpsensor%CTYPE(JI:JI) ) - kpos = kpos + 1 - END DO - PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XFF (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XDD (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES PBUFFER(KPOS:KPOS+IKU*ISTORES-1) = RESHAPE( TPSENSOR%XZZ (:,1:ISTORES), [IKU*ISTORES] ) ; KPOS = KPOS + IKU * ISTORES @@ -658,12 +651,6 @@ SUBROUTINE DATA_ARRAYS_ALLOCATE_PROFILER( TPSENSOR, KSTORE ) CALL TPSENSOR%BUFFER_UNPACK_STATPROF( PBUFFER, KPOS, KSTORE ) - ! Convert integers to characters - DO JI = 1, LEN(tpsensor%Ctype) - tpsensor%CTYPE(JI:JI) = ACHAR( NINT( pbuffer(kpos) ) ) - kpos = kpos + 1 - END DO - TPSENSOR%XFF (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE TPSENSOR%XDD (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE TPSENSOR%XZZ (:,1:KSTORE) = RESHAPE( PBUFFER(KPOS:KPOS+IKU*KSTORE-1), [ IKU, KSTORE ] ) ; KPOS = KPOS + IKU * KSTORE diff --git a/src/MNH/modn_aircrafts.f90 b/src/MNH/modn_aircrafts.f90 index 9825894e855b6f41f3ee2e4f4bec54f8ec0ae8f6..131b53fbbb2722ff259d62b46c32c76b69fd31c1 100644 --- a/src/MNH/modn_aircrafts.f90 +++ b/src/MNH/modn_aircrafts.f90 @@ -23,7 +23,7 @@ IMPLICIT NONE CHARACTER(LEN=3), DIMENSION(:), ALLOCATABLE :: CMODEL INTEGER, DIMENSION(:), ALLOCATABLE :: NMODEL -CHARACTER(LEN=6), DIMENSION(:), ALLOCATABLE :: CTYPE +CHARACTER(LEN=NSENSORNAMELGTMAX), DIMENSION(:), ALLOCATABLE :: CTYPE CHARACTER(LEN=NSENSORNAMELGTMAX), DIMENSION(:), ALLOCATABLE :: CTITLE TYPE(DATE_TIME), DIMENSION(:), ALLOCATABLE :: TLAUNCH REAL, DIMENSION(:), ALLOCATABLE :: XTSTEP @@ -31,7 +31,7 @@ INTEGER, DIMENSION(:), ALLOCATABLE :: NPOS LOGICAL, DIMENSION(:), ALLOCATABLE :: LALTDEF CHARACTER(LEN=NFILENAMELGTMAX), DIMENSION(:), ALLOCATABLE :: CFILE !Names of CSV files with trajectory data -!Do not read CTYPE, value is always forced to 'AIRCRA' +!Do not read CTYPE, value is always forced to 'AIRCRAFT' NAMELIST / NAM_AIRCRAFTS / CFILE, CMODEL, CTITLE, LALTDEF, NMODEL, NPOS, TLAUNCH, XTSTEP CONTAINS @@ -42,7 +42,7 @@ SUBROUTINE AIRCRAFTS_NML_ALLOCATE( KAIRCRAFTS ) !Note: the default values are used/checked in ini_aircraft => be careful to ensure coherency ALLOCATE( CMODEL (KAIRCRAFTS) ); CMODEL(:) = 'FIX' ALLOCATE( CTITLE (KAIRCRAFTS) ); CTITLE(:) = '' - ALLOCATE( CTYPE (KAIRCRAFTS) ); CTYPE(:) = 'AIRCRA' + ALLOCATE( CTYPE (KAIRCRAFTS) ); CTYPE(:) = 'AIRCRAFT' ALLOCATE( NMODEL (KAIRCRAFTS) ); NMODEL(:) = 0 ALLOCATE( TLAUNCH(KAIRCRAFTS) ) ALLOCATE( XTSTEP (KAIRCRAFTS) ); XTSTEP(:) = XNEGUNDEF diff --git a/src/MNH/modn_balloons.f90 b/src/MNH/modn_balloons.f90 index 96b840869aa12693162c5cd720d06ab1763596d3..4192ba28ad21484ce7bd700f8467fc7b645c76b9 100644 --- a/src/MNH/modn_balloons.f90 +++ b/src/MNH/modn_balloons.f90 @@ -23,7 +23,7 @@ IMPLICIT NONE CHARACTER(LEN=3), DIMENSION(:), ALLOCATABLE :: CMODEL INTEGER, DIMENSION(:), ALLOCATABLE :: NMODEL -CHARACTER(LEN=6), DIMENSION(:), ALLOCATABLE :: CTYPE +CHARACTER(LEN=NSENSORNAMELGTMAX), DIMENSION(:), ALLOCATABLE :: CTYPE CHARACTER(LEN=NSENSORNAMELGTMAX), DIMENSION(:), ALLOCATABLE :: CTITLE TYPE(DATE_TIME), DIMENSION(:), ALLOCATABLE :: TLAUNCH REAL, DIMENSION(:), ALLOCATABLE :: XLATLAUNCH diff --git a/src/MNH/statprof_tools.f90 b/src/MNH/statprof_tools.f90 index e91b8217998e6aaab7926dcf411a25a22d7e707e..2752493ad55bc8770d5d81b61f1db8f1de1aa1d1 100644 --- a/src/MNH/statprof_tools.f90 +++ b/src/MNH/statprof_tools.f90 @@ -190,6 +190,7 @@ SUBROUTINE PROFILER_ADD( TPPROFILER ) !Copy fields available in TSTATPROFDATA !other fields are not yet set TZPROFILERS(NUMBPROFILER_LOC)%CNAME = TPPROFILER%CNAME + TZPROFILERS(NUMBPROFILER_LOC)%CTYPE = 'PROFILER' TZPROFILERS(NUMBPROFILER_LOC)%NID = TPPROFILER%NID TZPROFILERS(NUMBPROFILER_LOC)%XX_CUR = TPPROFILER%XX_CUR TZPROFILERS(NUMBPROFILER_LOC)%XY_CUR = TPPROFILER%XY_CUR @@ -235,6 +236,7 @@ SUBROUTINE STATION_ADD( TPSTATION ) !Copy fields available in TSTATPROFDATA !other fields are not yet set TZSTATIONS(NUMBSTAT_LOC)%CNAME = TPSTATION%CNAME + TZSTATIONS(NUMBSTAT_LOC)%CTYPE = 'STATION' TZSTATIONS(NUMBSTAT_LOC)%NID = TPSTATION%NID TZSTATIONS(NUMBSTAT_LOC)%XX_CUR = TPSTATION%XX_CUR TZSTATIONS(NUMBSTAT_LOC)%XY_CUR = TPSTATION%XY_CUR