Skip to content
Snippets Groups Projects
Commit 9cdf8bdf authored by Don Morton's avatar Don Morton
Browse files

Incorporated checking of allocated dimensions in preprocessed files

versus the FLEXPART which reads them.  See

https://www.flexpart.eu/ticket/161
parent 29feaef9
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ MODULE fpmetbinary_mod ...@@ -30,6 +30,7 @@ MODULE fpmetbinary_mod
USE com_mod USE com_mod
USE conv_mod USE conv_mod
USE par_mod, ONLY : nxmax, nymax, nzmax, nuvzmax, nwzmax
IMPLICIT NONE IMPLICIT NONE
...@@ -247,10 +248,21 @@ CONTAINS ...@@ -247,10 +248,21 @@ CONTAINS
INTEGER, INTENT(IN) :: cm_index ! Index of last dimension in INTEGER, INTENT(IN) :: cm_index ! Index of last dimension in
! most com_mod variables. ! most com_mod variables.
! Should be 1 or 2 ! Should be 1 or 2
! These are temporary variables, used in the LOAD option, for
! comparing against the current values in FLEXPART of nxmax, nymax, ...
INTEGER :: temp_nxmax, temp_nymax, temp_nzmax, &
& temp_nuvzmax, temp_nwzmax
CHARACTER(LEN=128) :: errmesg CHARACTER(LEN=128) :: errmesg
if (op == 'DUMP') THEN if (op == 'DUMP') THEN
! Write the compiled max dimensions from par_mod - these are
! not meant to be reassigned during a LOAD, but used as "header"
! information to provide the structure of arrays
WRITE (iounit) nxmax, nymax, nzmax, nuvzmax, nwzmax
! Scalar values ! Scalar values
WRITE(iounit) nx, ny, nxmin1, nymin1, nxfield WRITE(iounit) nx, ny, nxmin1, nymin1, nxfield
WRITE(iounit) nuvz, nwz, nz, nmixz, nlev_ec WRITE(iounit) nuvz, nwz, nz, nmixz, nlev_ec
...@@ -389,6 +401,33 @@ CONTAINS ...@@ -389,6 +401,33 @@ CONTAINS
ELSE IF (op == 'LOAD') THEN ELSE IF (op == 'LOAD') THEN
! Read the compiled max dimensions that were dumped from par_mod
! when creating the fp file, so that we can compare against
! current FLEXPART dimensions - they need to be the same, or else
! we abort.
READ (iounit) temp_nxmax, temp_nymax, temp_nzmax, &
& temp_nuvzmax, temp_nwzmax
IF ( (temp_nxmax == nxmax) .AND. (temp_nymax == nymax) .AND. &
& (temp_nzmax == nzmax) .AND. &
& (temp_nuvzmax == nuvzmax) .AND. &
& (temp_nwzmax == nwzmax) ) THEN
CONTINUE
ELSE
PRINT *, 'Incompatible dimensions between fp file and current FLEXPART!'
PRINT *, ''
PRINT *, ' FP file Compiled FP'
PRINT *, 'nxmax: ', temp_nxmax, ' ', nxmax
PRINT *, 'nymax: ', temp_nymax, ' ', nymax
PRINT *, 'nzmax: ', temp_nzmax, ' ', nzmax
PRINT *, 'nuvzmax: ', temp_nuvzmax, ' ', nuvzmax
PRINT *, 'nwzmax: ', temp_nwzmax, ' ', nwzmax
PRINT *, ''
STOP
END IF
! Scalar values ! Scalar values
READ(iounit) nx, ny, nxmin1, nymin1, nxfield READ(iounit) nx, ny, nxmin1, nymin1, nxfield
READ(iounit) nuvz, nwz, nz, nmixz, nlev_ec READ(iounit) nuvz, nwz, nz, nmixz, nlev_ec
......
...@@ -129,7 +129,7 @@ module par_mod ...@@ -129,7 +129,7 @@ module par_mod
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=61,nwzmax=61,nzmax=61 !integer,parameter :: nxmax=361,nymax=181,nuvzmax=61,nwzmax=61,nzmax=61
integer,parameter :: nxmax=721,nymax=361,nuvzmax=140,nwzmax=140,nzmax=140 integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138
!integer,parameter :: nxshift=359 ! for ECMWF !integer,parameter :: nxshift=359 ! for ECMWF
integer,parameter :: nxshift=0 ! for GFS integer,parameter :: nxshift=0 ! for GFS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment