7 |
SUBROUTINE histvert(pfileid, pzaxname, pzaxtitle, pzaxunit, pzsize, & |
SUBROUTINE histvert(pfileid, pzaxname, pzaxtitle, pzaxunit, pzsize, & |
8 |
pzvalues, pzaxid, pdirect) |
pzvalues, pzaxid, pdirect) |
9 |
|
|
10 |
! This subroutine defines a vertical axis and returns it s id. |
! This subroutine defines a vertical axis and returns its id. It |
11 |
! It gives the user the possibility to the user to define many |
! gives the user the possibility to define many different vertical |
12 |
! different vertical axes. For each variable defined with histdef a |
! axes. For each variable defined with histdef a vertical axis can |
13 |
! vertical axis can be specified with by it s ID. |
! be specified by its ID. |
|
|
|
|
! INPUT |
|
|
|
|
|
! pfileid: ID of the file the variable should be archived in |
|
|
! pzaxname: Name of the vertical axis |
|
|
! pzaxtitle: title of the vertical axis |
|
|
! pzaxunit: Units of the vertical axis |
|
|
! pzsize: size of the vertical axis |
|
|
! pzvalues: Coordinate values of the vetical axis |
|
|
|
|
|
! pdirect: is an optional argument which allows to specify the |
|
|
! the positive direction of the axis: up or down. |
|
|
! OUTPUT |
|
|
|
|
|
! pzaxid: Returns the ID of the axis. |
|
|
! Note that this is not the netCDF ID ! |
|
14 |
|
|
15 |
USE find_str_m, ONLY: find_str |
USE find_str_m, ONLY: find_str |
16 |
USE strlowercase_m, ONLY: strlowercase |
USE strlowercase_m, ONLY: strlowercase |
20 |
USE netcdf, ONLY: nf90_def_dim, nf90_def_var, nf90_enddef, & |
USE netcdf, ONLY: nf90_def_dim, nf90_def_var, nf90_enddef, & |
21 |
nf90_float, nf90_put_att, nf90_put_var, nf90_redef |
nf90_float, nf90_put_att, nf90_put_var, nf90_redef |
22 |
|
|
23 |
INTEGER, INTENT (IN):: pfileid, pzsize |
INTEGER, INTENT(IN):: pfileid |
24 |
CHARACTER (len=*), INTENT (IN):: pzaxname, pzaxunit, pzaxtitle |
! ID of the file the variable should be archived in |
25 |
REAL, INTENT (IN):: pzvalues(pzsize) |
|
26 |
INTEGER, INTENT (OUT):: pzaxid |
INTEGER, INTENT(IN):: pzsize ! size of the vertical axis |
27 |
CHARACTER (len=*), INTENT (IN), OPTIONAL:: pdirect |
CHARACTER(len=*), INTENT(IN):: pzaxname ! name of the vertical axis |
28 |
|
CHARACTER(len=*), INTENT(IN):: pzaxunit ! units of the vertical axis |
29 |
|
CHARACTER(len=*), INTENT(IN):: pzaxtitle ! title of the vertical axis |
30 |
|
REAL, INTENT(IN):: pzvalues(pzsize) ! coordinate values of the vetical axis |
31 |
|
INTEGER, INTENT(OUT):: pzaxid ! ID of the axis (not the netCDF ID) |
32 |
|
|
33 |
|
CHARACTER(len=*), INTENT(IN), OPTIONAL:: pdirect |
34 |
|
! positive direction of the axis: up or down |
35 |
|
|
36 |
|
! Local: |
37 |
INTEGER:: pos, iv, nb, zdimid, zaxid_tmp |
INTEGER:: pos, iv, nb, zdimid, zaxid_tmp |
38 |
CHARACTER (len=20):: str20, tab_str20(nb_zax_max) |
CHARACTER(len=20):: str20, tab_str20(nb_zax_max) |
39 |
INTEGER:: tab_str20_length(nb_zax_max) |
INTEGER:: tab_str20_length(nb_zax_max) |
40 |
CHARACTER (len=70):: str70, str71, str72 |
CHARACTER(len=70):: str70, str71, str72 |
41 |
CHARACTER (len=80):: str80 |
CHARACTER(len=80):: str80 |
42 |
CHARACTER (len=20):: direction |
CHARACTER(len=20):: direction |
43 |
INTEGER:: iret, leng, ncid |
INTEGER:: iret, leng, ncid |
44 |
|
|
45 |
!--------------------------------------------------------------------- |
!--------------------------------------------------------------------- |
89 |
|
|
90 |
IF (pos>0) THEN |
IF (pos>0) THEN |
91 |
str70 = 'Vertical axis already exists' |
str70 = 'Vertical axis already exists' |
92 |
WRITE (str71, '("Check variable ", a, " in file", I3)') str20, & |
WRITE(str71, '("Check variable ", a, " in file", I3)') str20, & |
93 |
pfileid |
pfileid |
94 |
str72 = 'Can also be a wrong file ID in another declaration' |
str72 = 'Can also be a wrong file ID in another declaration' |
95 |
CALL histerr(3, 'histvert', str70, str71, str72) |
CALL histerr(3, 'histvert', str70, str71, str72) |