Changeset 1028 for IOIPSL/trunk


Ignore:
Timestamp:
05/20/10 17:17:30 (14 years ago)
Author:
bellier
Message:

The positive direction of a vertical axis must be "up" or "down".
If the optional argument pdirect of histvert is not given or is invalid,
the attribute will not be written in the Netcdf file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • IOIPSL/trunk/src/histcom.f90

    r1027 r1028  
    823823  INTEGER :: pos,iv,zdimid,zaxid_tmp 
    824824  CHARACTER(LEN=70) :: str71 
    825   CHARACTER(LEN=80) :: str80 
    826825  CHARACTER(LEN=20) :: direction 
    827826  INTEGER :: iret,leng,nfid 
     
    837836 &                      pzaxname,'---',pzaxunit,'---',pzaxtitle 
    838837!- 
    839 ! - Direction of axis. Can we get if from the user. 
    840 !   If not we put unknown. 
     838! Direction of the vertical axis. Can we get if from the user. 
    841839!- 
    842840  IF (PRESENT(pdirect)) THEN 
     
    849847! Check the consistency of the attribute 
    850848!- 
    851   IF (     (direction /= 'unknown') & 
    852  &    .AND.(direction /= 'up')      & 
    853  &    .AND.(direction /= 'down')   ) THEN 
     849  IF (     PRESENT(pdirect)    & 
     850 &    .AND.(direction /= 'up') & 
     851 &    .AND.(direction /= 'down') ) THEN 
    854852    direction = 'unknown' 
    855     str80 = 'The specified axis was : '//TRIM(direction) 
    856853    CALL ipslerr (2,"histvert",& 
    857    & "The specified direction for the vertical axis is not possible.",& 
    858    & "it is replaced by : unknown",str80) 
     854 & "The specified positive direction for the vertical axis is invalid.",& 
     855 & "The value must be up or down.","The attribute will not be written.") 
    859856  ENDIF 
    860857!- 
     
    900897    iret = NF90_PUT_ATT (nfid,zdimid,'units',pzaxunit(1:leng)) 
    901898  ENDIF 
    902   iret = NF90_PUT_ATT (nfid,zdimid,'positive',TRIM(direction)) 
     899  IF (direction /= 'unknown') THEN 
     900    iret = NF90_PUT_ATT (nfid,zdimid,'positive',TRIM(direction)) 
     901  ENDIF 
    903902  iret = NF90_PUT_ATT (nfid,zdimid,'valid_min', & 
    904903 &                     REAL(MINVAL(pzvalues(1:pzsize)),KIND=4)) 
Note: See TracChangeset for help on using the changeset viewer.