Ignore:
Timestamp:
Jun 14, 2013, 9:17:44 AM (12 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/libf/phystd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.