Skip to content
Snippets Groups Projects
Commit fc03d9ea authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 27/01/2020: create the tfield_metadata_base abstract datatype and use...

Philippe 27/01/2020: create the tfield_metadata_base abstract datatype and use it as a basis for several datatypes
parent b0eee13e
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
! P. Wautelet 12/04/2019: added pointers for C1D, L1D, N1D, X5D and X6D structures in TFIELDDATA ! P. Wautelet 12/04/2019: added pointers for C1D, L1D, N1D, X5D and X6D structures in TFIELDDATA
! P. Wautelet 12/07/2019: add pointers for T1D structure in TFIELDDATA ! P. Wautelet 12/07/2019: add pointers for T1D structure in TFIELDDATA
! P. Wautelet 23/01/2020: split in modd_field.f90 and mode_field.f90 ! P. Wautelet 23/01/2020: split in modd_field.f90 and mode_field.f90
! P. Wautelet 27/01/2020: create the tfield_metadata_base abstract datatype
!----------------------------------------------------------------- !-----------------------------------------------------------------
module modd_field module modd_field
...@@ -91,20 +92,15 @@ TYPE TFIELDPTR_T1D ...@@ -91,20 +92,15 @@ TYPE TFIELDPTR_T1D
TYPE(DATE_TIME), DIMENSION(:), POINTER :: DATA => NULL() TYPE(DATE_TIME), DIMENSION(:), POINTER :: DATA => NULL()
END TYPE TFIELDPTR_T1D END TYPE TFIELDPTR_T1D
! !
!Structure describing the characteristics of a field type, abstract :: tfield_metadata_base
TYPE :: TFIELDDATA
CHARACTER(LEN=NMNHNAMELGTMAX) :: 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=NSTDNAMELGTMAX) :: CSTDNAME = '' !Standard name (CF convention) CHARACTER(LEN=NSTDNAMELGTMAX) :: CSTDNAME = '' !Standard name (CF convention)
CHARACTER(LEN=32) :: CLONGNAME = '' !Long name (CF convention) CHARACTER(LEN=32) :: CLONGNAME = '' !Long name (CF convention)
CHARACTER(LEN=40) :: CUNITS = '' !Canonical units (CF convention) CHARACTER(LEN=40) :: CUNITS = '' !Canonical units (CF convention)
CHARACTER(LEN=2) :: CDIR = '' !Type of the data field (XX,XY,--...)
CHARACTER(LEN=4) :: CLBTYPE = 'NONE' !Type of the lateral boundary (LBX,LBY,LBXU,LBYV)
CHARACTER(LEN=100) :: CCOMMENT = '' !Comment (for MesoNH, non CF convention) CHARACTER(LEN=100) :: CCOMMENT = '' !Comment (for MesoNH, non CF convention)
INTEGER :: NGRID = NGRIDUNKNOWN !Localization on the model grid INTEGER :: NGRID = NGRIDUNKNOWN !Localization on the model grid
INTEGER :: NTYPE = TYPEUNDEF !Datatype INTEGER :: NTYPE = TYPEUNDEF !Datatype
INTEGER :: NDIMS = 0 !Number of dimensions INTEGER :: NDIMS = 0 !Number of dimensions
LOGICAL :: LTIMEDEP = .FALSE. !Is the field time-dependent?
!
#if defined(MNH_IOCDF4) #if defined(MNH_IOCDF4)
INTEGER :: NFILLVALUE = NF90_FILL_INT !Fill value for integer fields INTEGER :: NFILLVALUE = NF90_FILL_INT !Fill value for integer fields
REAL :: XFILLVALUE = NF90_FILL_REAL !Fill value for real fields REAL :: XFILLVALUE = NF90_FILL_REAL !Fill value for real fields
...@@ -119,6 +115,13 @@ TYPE :: TFIELDDATA ...@@ -119,6 +115,13 @@ TYPE :: TFIELDDATA
INTEGER :: NVALIDMAX = 2147483647 !Maximum valid value for integer fields INTEGER :: NVALIDMAX = 2147483647 !Maximum valid value for integer fields
REAL :: XVALIDMIN = -1.E36 !Minimum valid value for real fields REAL :: XVALIDMIN = -1.E36 !Minimum valid value for real fields
REAL :: XVALIDMAX = 1.E36 !Maximum valid value for real fields REAL :: XVALIDMAX = 1.E36 !Maximum valid value for real fields
end type tfield_metadata_base
!Structure describing the characteristics of a field
TYPE, extends( tfield_metadata_base ) :: TFIELDDATA
CHARACTER(LEN=2) :: CDIR = '' !Type of the data field (XX,XY,--...)
CHARACTER(LEN=4) :: CLBTYPE = 'NONE' !Type of the lateral boundary (LBX,LBY,LBXU,LBYV)
LOGICAL :: LTIMEDEP = .FALSE. !Is the field time-dependent?
! !
TYPE(TFIELDPTR_C0D),DIMENSION(:),ALLOCATABLE :: TFIELD_C0D !Pointer to the character string fields (one per nested mesh) TYPE(TFIELDPTR_C0D),DIMENSION(:),ALLOCATABLE :: TFIELD_C0D !Pointer to the character string fields (one per nested mesh)
TYPE(TFIELDPTR_C1D),DIMENSION(:),ALLOCATABLE :: TFIELD_C1D !Pointer to the character string 1D fields (one per nested mesh) TYPE(TFIELDPTR_C1D),DIMENSION(:),ALLOCATABLE :: TFIELD_C1D !Pointer to the character string 1D fields (one per nested mesh)
......
...@@ -46,11 +46,14 @@ ...@@ -46,11 +46,14 @@
! P. Wautelet 19/07/2019: parameters to identify budget number ! P. Wautelet 19/07/2019: parameters to identify budget number
! P. Wautelet 15/11/2019: remove unused CBURECORD variable ! P. Wautelet 15/11/2019: remove unused CBURECORD variable
! P. Wautelet 17/01/2020: add new budget data types ! P. Wautelet 17/01/2020: add new budget data types
! P. Wautelet 27/01/2020: use the tfield_metadata_base abstract datatype
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
!* 0. DECLARATIONS !* 0. DECLARATIONS
! ------------ ! ------------
USE MODD_PARAMETERS, ONLY :JPBUMAX, JPBUPROMAX, NBUNAMELGTMAX, NCOMMENTLGTMAX
use modd_field, only: tfield_metadata_base
use modd_parameters, only: JPBUMAX, JPBUPROMAX, NBUNAMELGTMAX, NCOMMENTLGTMAX
implicit none implicit none
...@@ -89,8 +92,7 @@ type tbudgetdata ...@@ -89,8 +92,7 @@ type tbudgetdata
end type tbudgetdata end type tbudgetdata
type tbusourcedata type, extends( tfield_metadata_base ) :: tbusourcedata
character(len=NBUNAMELGTMAX) :: cname = ''
integer :: ngroup = 0 ! Number of the source term group in which storing the source term integer :: ngroup = 0 ! Number of the source term group in which storing the source term
! (0: no store, 1: individual store, >1: number of the group) ! (0: no store, 1: individual store, >1: number of the group)
logical :: lenabled = .false. logical :: lenabled = .false.
...@@ -100,8 +102,7 @@ type tbusourcedata ...@@ -100,8 +102,7 @@ type tbusourcedata
! It may be true only if the source term is in a group not containing other sources ! It may be true only if the source term is in a group not containing other sources
end type tbusourcedata end type tbusourcedata
type tbugroupdata type, extends( tfield_metadata_base ) :: tbugroupdata
character(len=NBUNAMELGTMAX) :: cname = ''
integer :: nsources = 0 ! Number of source terms composing this group integer :: nsources = 0 ! Number of source terms composing this group
integer, dimension(:), allocatable :: nsourcelist ! List of the source terms composing this group integer, dimension(:), allocatable :: nsourcelist ! List of the source terms composing this group
real, dimension(:,:,:), allocatable :: xdata ! Array to store the budget data real, dimension(:,:,:), allocatable :: xdata ! Array to store the budget data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment