Changeset 1808 for IOIPSL/trunk
- Timestamp:
- 07/16/12 10:07:18 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/flincom.f90
r1660 r1808 739 739 zid = iv; llm = lll; 740 740 ELSE IF ( (INDEX(axname,'tstep') == 1) & 741 .OR.(INDEX(axname,'time') == 1) & 741 742 .OR.(INDEX(axname,'time_counter') == 1) ) THEN 742 743 !---- For the time we certainly need to allow for other names … … 1678 1679 ! LOCAL 1679 1680 !- 1680 INTEGER :: iret, fid 1681 INTEGER :: iret, fid, vid 1682 INTEGER :: attlen, attnum 1683 INTEGER :: ndims, nb_atts 1684 INTEGER,DIMENSION(NF90_MAX_VAR_DIMS) :: dimids 1685 LOGICAL :: var_exists 1681 1686 !- 1682 1687 LOGICAL :: l_dbg … … 1685 1690 1686 1691 IF (l_dbg) THEN 1687 WRITE ( *,*) 'flinget_scal in file with id ',fid_in1692 WRITE (ipslout,*) 'flinget_scal in file with id ',fid_in 1688 1693 ENDIF 1689 1694 !- 1690 1695 fid = ncids(fid_in) 1696 iret = NF90_INQUIRE_ATTRIBUTE(fid, NF90_GLOBAL, varname, len=attlen, attnum=attnum) 1691 1697 !- 1692 1698 ! 1.0 Reading a global attribute 1693 1699 !- 1694 iret = NF90_GET_ATT (fid, NF90_GLOBAL, varname, var) 1700 IF ( iret == nf90_noerr ) THEN 1701 ! 1702 ! This seems to be a Global attribute 1703 ! 1704 iret = NF90_GET_ATT (fid, NF90_GLOBAL, varname, var) 1705 ELSE 1706 ! 1707 ! If there was an error on the test for a global attribute it 1708 ! is perhaps a scalar variable. 1709 ! 1710 vid = -1 1711 iret = NF90_INQ_VARID (fid, varname, vid) 1712 ! 1713 IF ( (vid >= 0).AND.(iret == NF90_NOERR) ) THEN 1714 iret = NF90_INQUIRE_VARIABLE (fid, vid, & 1715 ndims=ndims, dimids=dimids, nAtts=nb_atts) 1716 IF ( (ndims == 0) .AND. (nb_atts >= 0) ) THEN 1717 iret = NF90_GET_VAR(fid, vid, var) 1718 ELSE 1719 CALL histerr (3,'flinget_scal', & 1720 'The variable has coordinates and thus is probably not a scalar.', & 1721 'Check your netCDF file.', " ") 1722 ENDIF 1723 ENDIF 1724 IF (l_dbg) THEN 1725 WRITE(ipslout,*) "Reading a Scalar value for varibale ", varname," It has value ", var 1726 ENDIF 1727 ENDIF 1728 !- 1695 1729 !--------------------------- 1696 1730 END SUBROUTINE flinget_scal
Note: See TracChangeset
for help on using the changeset viewer.