Changeset 3057 for trunk/LMDZ.MARS/util/zrecast.F90
- Timestamp:
- Sep 27, 2023, 8:42:36 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/zrecast.F90
r2567 r3057 1567 1567 stop 1568 1568 endif 1569 ierr=NF_PUT_ATT_REAL(outfid,za_varid,'_FillValue',NF_REAL,1,miss_val) ! redundant attribute for newer NCO versions 1570 if (ierr.ne.NF_NOERR) then 1571 write(*,*) "Error: Problem writing _FillValue for zareoid" 1572 stop 1573 endif 1569 1574 else ! above areoid or above local surface vertical coordinate 1570 1575 ! pressure dataset … … 1592 1597 if (ierr.ne.NF_NOERR) then 1593 1598 write(*,*) "Error: Problem writing missing_value for pressure" 1599 stop 1600 endif 1601 ierr=NF_PUT_ATT_REAL(outfid,p_varid,'_FillValue',NF_REAL,1,miss_val) ! redundant attribute for newer NCO versions 1602 if (ierr.ne.NF_NOERR) then 1603 write(*,*) "Error: Problem writing _FillValue for pressure" 1594 1604 stop 1595 1605 endif … … 1712 1722 write(*,*) "Found missing_value ",miss_val 1713 1723 j=j+1 1714 else ! no 'missing_value' attribute, set miss_val to default 1715 miss_val=miss_val_def 1724 else ! no 'missing_value' attribute, look for '_FillValue' attribute 1725 ierr=NF_GET_ATT_REAL(infid,tmpvarid,"_FillValue",miss_val) 1726 if (ierr.eq.NF_NOERR) then ! found '_FillValue' attribute 1727 write(*,*) "Found missing_value ",miss_val 1728 j=j+1 1729 else ! no 'missing_value' attribute, set miss_val to default 1730 miss_val=miss_val_def 1731 endif 1716 1732 endif 1717 1733 … … 1720 1736 if (ierr.ne.NF_NOERR) then 1721 1737 write(*,*) "Error, failed to write missing_value attribute" 1738 stop 1739 endif 1740 ierr=NF_PUT_ATT_REAL(outfid,var_id(i),'_FillValue',NF_REAL,1,miss_val) ! redundant attribute for newer NCO versions 1741 if (ierr.ne.NF_NOERR) then 1742 write(*,*) "Error, failed to write _FillValue attribute" 1722 1743 stop 1723 1744 endif … … 2864 2885 za(kloop)=z_gcm(iloop,jloop,kloop,tloop) 2865 2886 ! store log values along altitude 2866 logq(kloop)=log(gcmdata(iloop,jloop,kloop,tloop)) 2887 if (gcmdata(iloop,jloop,kloop,tloop).gt.0) then ! sanity check to handle small negative or null values 2888 logq(kloop)=log(gcmdata(iloop,jloop,kloop,tloop)) 2889 else ! gcmdata<=0 2890 logq(kloop)=-1000 ! yields a value of 1e-435 for q that is well below the numerical precision => 0 2891 endif ! gcmdata>0 2867 2892 enddo !kloop 2868 2893 … … 3028 3053 z(kloop)=z_gcm(iloop,jloop,kloop,tloop) 3029 3054 ! store log values along altitude 3030 logq(kloop)=log(gcmdata(iloop,jloop,kloop,tloop)) 3055 if (gcmdata(iloop,jloop,kloop,tloop).gt.0) then ! sanity check to handle small negative or null values 3056 logq(kloop)=log(gcmdata(iloop,jloop,kloop,tloop)) 3057 else ! gcmdata<=0 3058 logq(kloop)=-1000 ! yields a value of 1e-435 for q that is well below the numerical precision => 0 3059 endif ! gcmdata>0 3031 3060 enddo !kloop 3032 3061
Note: See TracChangeset
for help on using the changeset viewer.