Changeset 989 for trunk


Ignore:
Timestamp:
Jun 14, 2013, 9:17:44 AM (11 years ago)
Author:
emillour
Message:

Generic GCM:

  • Some minor changes so that gcm compiles with gfortran:
    • Added option to compile "long lines" (>132 characters) in makegcm_gfortran
    • Removed use of isnan() in physiq.F90 (it is not a standard function)
    • Avoid possible underflow of psat in watercommon_h.F90
    • Adapted the checks on the *IR and *VI band files to be more strict

EM

Location:
trunk/LMDZ.GENERIC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r988 r989  
    960960  - in dyn3d: removed unused inigrads.F wrgrads.F gradsdef.h
    961961              xvik.F (specific to current Mars)
     962
     963== 14/06/2013 == EM
     964- Some minor changes so that gcm compiles with gfortran:
     965  - Added option to compile "long lines" (>132 characters) in makegcm_gfortran
     966  - Removed use of isnan() in physiq.F90 (it is not a standard function)
     967  - Avoid possible underflow of psat in watercommon_h.F90
     968  - Adapted the checks on the *IR and *VI band files to be more strict
     969
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r969 r989  
    11031103                  enddo
    11041104                  dEtot=cpp*SUM(massarea(:,:)*(dtlscale(:,:)))/totarea
    1105                   if(isnan(dEtot)) then
    1106                      print*,'Nan in largescale, abort'
    1107                      STOP
    1108                   endif
     1105!                 if(isnan(dEtot)) then ! NB: isnan() is not a standard function...
     1106!                    print*,'Nan in largescale, abort'
     1107!                     STOP
     1108!                 endif
    11091109                  print*,'In largescale atmospheric energy change =',dEtot,' W m-2'
    11101110
  • trunk/LMDZ.GENERIC/libf/phystd/setspi.F90

    r961 r989  
    3333      logical file_ok
    3434      integer nw, nt, m, mm, file_entries
    35       real*8 a, b, ans, y, bpa, bma, T
     35      real*8 a, b, ans, y, bpa, bma, T, dummy
    3636
    3737      character(len=30)  :: temp1
     
    4848
    4949      !! used to count lines
    50       integer :: nb=-1  !because first line is not an actual value
     50      integer :: nb=0
    5151      integer :: ierr=0
    5252
     
    9494      ! check that the file contains the right number of bands
    9595      open(131,file=file_path,form='formatted')
     96      read(131,*,iostat=ierr) file_entries
    9697      do while (ierr==0)
    97         read(131,*,iostat=ierr) file_entries
     98        read(131,*,iostat=ierr) dummy
     99!        write(*,*) 'setspi: file_entries:',dummy,'ierr=',ierr
    98100        if (ierr==0) nb=nb+1
    99101      enddo
    100102      close(131)
     103
    101104      write(*,*) 'setspi: L_NSPECTI = ',L_NSPECTI, 'in the model '
    102105      write(*,*) '        there are   ',nb, 'entries in ',TRIM(file_path)
  • trunk/LMDZ.GENERIC/libf/phystd/setspv.F90

    r789 r989  
    4444
    4545      real*8 STELLAR(L_NSPECTV)
    46       real*8 sum
     46      real*8 sum, dummy
    4747
    4848      !! used to count lines
    49       integer :: nb=-1  !because first line is not an actual value
     49      integer :: nb=0
    5050      integer :: ierr=0
    5151
     
    7272      ! check that the file contains the right number of bands
    7373      open(131,file=file_path,form='formatted')
     74      read(131,*,iostat=ierr) file_entries
    7475      do while (ierr==0)
    75         read(131,*,iostat=ierr) file_entries
     76        read(131,*,iostat=ierr) dummy
    7677        if (ierr==0) nb=nb+1
    7778      enddo
    7879      close(131)
     80
    7981      write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model '
    8082      write(*,*) '        there are   ',nb, 'entries in ',TRIM(file_path)
  • trunk/LMDZ.GENERIC/libf/phystd/watercommon_h.F90

    r875 r989  
    6161         else if (T.lt.Tmin) then
    6262            print*, "careful, T<Tmin in psat water"
    63             psat = Pref_solid_liquid*Exp(r3sublimation*(Tmin-T_h2O_ice_liq)/(Tmin-Trefsublimation)) ! min psat 
     63          !  psat = Pref_solid_liquid*Exp(r3sublimation*(Tmin-T_h2O_ice_liq)/(Tmin-Trefsublimation)) ! min psat 
     64         ! Ehouarn: gfortran says: Error: Result of EXP underflows its kind,
     65         !          so set psat to the smallest possible value instead
     66            psat=tiny(psat)
    6467         else                 
    6568            psat = Pref_solid_liquid*Exp(r3sublimation*(T-T_h2O_ice_liq)/(T-Trefsublimation)) ! solid / vapour
  • trunk/LMDZ.GENERIC/makegcm_gfortran

    r988 r989  
    387387
    388388           ## for gfortran
    389            set optim="-g -finit-real=-inf -finit-integer=-999999 -Wall -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow"
    390            set optim90="-g -finit-real=-inf -finit-integer=-999999 -Wall -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow"
    391            set optimtru90="-g -finit-real=-inf -finit-integer=-999999 -Wall -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow"
     389           set optim="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow"
     390           set optim90="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow"
     391           set optimtru90="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow"
    392392
    393393        else
     
    653653   set f90=f90
    654654else if $LINUX then
    655    set f77=gfortran
    656    set f90=gfortran
     655# default for gfortran is that "free format" is up to 132 characters,
     656# but we sometimes have more, so move that limit to 264 characters
     657   set f77="gfortran -ffree-line-length-264"
     658   set f90="gfortran -ffree-line-length-264"
    657659   set opt_link=" -L$LIBOGCM -L$NCDFLIB -lnetcdff -lnetcdf "
    658660else if $SUN then
Note: See TracChangeset for help on using the changeset viewer.