Changeset 322 for trunk/LMDZ.MARS/util


Ignore:
Timestamp:
Oct 21, 2011, 10:59:42 AM (13 years ago)
Author:
emillour
Message:

Mars Utility:
Bug fix in concatnc by TN: outputs in Ls would sometimes be wrong by
+ or - 360 at transitions between years.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/concatnc.F90

    r280 r322  
    10851085ierr=NF_INQ_VARID(nid,"Time",nvarid)
    10861086if (ierr.NE.NF_NOERR) then
    1087    write(*,*) 'ERROR: Field <Time> not found'
     1087   write(*,*) 'ERROR in change_time_axis: Field <Time> not found'
    10881088   print*, NF_STRERROR(ierr)
    10891089   stop ""
     
    10971097ierr = NF_GET_VAR_REAL(nid,nvarid,time)
    10981098#endif
     1099if (ierr.ne.NF_NOERR) then
     1100  write(*,*) "ERROR in change_time_axis: Failed to load Time"
     1101  stop
     1102endif
    10991103
    11001104!==============================================================================
     
    11071111
    11081112!==============================================================================
    1109 ! 2. Write
     1113! 2.1 Check if there are not jumps in Ls (rounding problems in sol2ls)
     1114!==============================================================================
     1115
     1116do i=1,timelen-1
     1117   if ((ls(i+1)-ls(i)) > 350) then
     1118       write(*,*) "+ 360° Ls jump solved:", ls(i), ls(i+1), "at timestep", i
     1119      ls(i+1) = ls(i+1) - 360
     1120       write(*,*) " corrected to now be:", ls(i), ls(i+1)
     1121   else if ((ls(i)-ls(i+1)) > 350) then
     1122       write(*,*) "- 360° Ls jump solved:", ls(i), ls(i+1), "at timestep", i
     1123      ls(i+1) = ls(i+1) + 360
     1124       write(*,*) " corrected to now be:", ls(i), ls(i+1)
     1125   endif
     1126enddo
     1127
     1128!==============================================================================
     1129! 3. Write
    11101130!==============================================================================
    11111131
     
    11151135ierr = NF_PUT_VAR_REAL(nid,nvarid,ls)
    11161136#endif
     1137if (ierr.ne.NF_NOERR) then
     1138  write(*,*) "ERROR in change_time_axis: Failed to write Ls"
     1139  stop
     1140endif
    11171141
    11181142end subroutine change_time_axis
Note: See TracChangeset for help on using the changeset viewer.