Ignore:
Timestamp:
Jul 24, 2024, 2:54:37 PM (2 months ago)
Author:
abarral
Message:

rename modules properly lmdz_*
move ismin, ismax, minmax into new lmdz_libmath.f90
(lint) uppercase fortran keywords

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert_noterre.f90

    r5113 r5116  
    3030  REAL :: snorm
    3131  REAL :: alpha,beta,gama,delta,deltaz
    32   real :: quoi,quand
     32  REAL :: quoi,quand
    3333  REAL :: zsig(llm),sig(llm+1)
    3434  INTEGER :: np,ierr
    35   integer :: ierr1,ierr2,ierr3,ierr4
     35  INTEGER :: ierr1,ierr2,ierr3,ierr4
    3636  REAL :: x
    3737
    3838  REAL :: SSUM
    3939  EXTERNAL SSUM
    40   real :: newsig
     40  REAL :: newsig
    4141  REAL :: dz0,dz1,nhaut,sig1,esig,csig,zz
    42   real :: tt,rr,gg, prevz
    43   real :: s(llm),dsig(llm)
    44 
    45   integer :: iz
    46   real :: z, ps,p
    47   character(len=*),parameter :: modname="disvert_noterre"
     42  REAL :: tt,rr,gg, prevz
     43  REAL :: s(llm),dsig(llm)
     44
     45  INTEGER :: iz
     46  REAL :: z, ps,p
     47  CHARACTER(LEN=*),parameter :: modname="disvert_noterre"
    4848
    4949  !
     
    5555  hybrid=.TRUE. ! default value for hybrid (ie: use hybrid coordinates)
    5656  CALL getin('hybrid',hybrid)
    57   write(lunout,*) trim(modname),': hybrid=',hybrid
     57  WRITE(lunout,*) trim(modname),': hybrid=',hybrid
    5858
    5959  ! Ouverture possible de fichiers typiquement E.T.
     
    6161     open(99,file="esasig.def",status='old',form='formatted', &
    6262           iostat=ierr2)
    63      if(ierr2/=0) then
     63     IF(ierr2/=0) THEN
    6464          close(99)
    6565          open(99,file="z2sig.def",status='old',form='formatted', &
     
    7171  !   ----------------------------------------
    7272
    73   IF(ierr2==0) then
    74 
     73  IF(ierr2==0) THEN
    7574     ! Lecture de esasig.def :
    7675     ! Systeme peu souple, mais qui respecte en theorie
     
    7877     ! <-> energie cinetique, d'apres la note de Frederic Hourdin...
    7978
    80      write(lunout,*)'*****************************'
    81      write(lunout,*)'WARNING reading esasig.def'
    82      write(lunout,*)'*****************************'
     79     WRITE(lunout,*)'*****************************'
     80     WRITE(lunout,*)'WARNING reading esasig.def'
     81     WRITE(lunout,*)'*****************************'
    8382     READ(99,*) scaleheight
    8483     READ(99,*) dz0
     
    126125  !   ----------------------------------------
    127126
    128   ELSE IF(ierr4==0) then
    129      write(lunout,*)'****************************'
    130      write(lunout,*)'Reading z2sig.def'
    131      write(lunout,*)'****************************'
     127  ELSE IF(ierr4==0) THEN
     128     WRITE(lunout,*)'****************************'
     129     WRITE(lunout,*)'Reading z2sig.def'
     130     WRITE(lunout,*)'****************************'
    132131
    133132     READ(99,*) scaleheight
     
    146145  !-----------------------------------------------------------------------
    147146  ELSE
    148      write(lunout,*) 'didn t you forget something ??? '
    149      write(lunout,*) 'We need file  z2sig.def ! (OR esasig.def)'
     147     WRITE(lunout,*) 'didn t you forget something ??? '
     148     WRITE(lunout,*) 'We need file  z2sig.def ! (OR esasig.def)'
    150149     stop
    151150  ENDIF
     
    170169
    171170  if (hybrid) then  ! use hybrid coordinates
    172      write(lunout,*) "*********************************"
    173      write(lunout,*) "Using hybrid vertical coordinates"
    174      write(lunout,*)
     171     WRITE(lunout,*) "*********************************"
     172     WRITE(lunout,*) "Using hybrid vertical coordinates"
     173     WRITE(lunout,*)
    175174     ! Coordonnees hybrides avec mod
    176175     DO l = 1, llm
     
    183182     ap(llmp1) = 0.
    184183  else ! use sigma coordinates
    185      write(lunout,*) "********************************"
    186      write(lunout,*) "Using sigma vertical coordinates"
    187      write(lunout,*)
     184     WRITE(lunout,*) "********************************"
     185     WRITE(lunout,*) "Using sigma vertical coordinates"
     186     WRITE(lunout,*)
    188187     ! Pour ne pas passer en coordonnees hybrides
    189188     DO l = 1, llm
     
    196195  bp(llmp1) =   0.
    197196
    198   write(lunout,*) trim(modname),': BP '
    199   write(lunout,*)  bp
    200   write(lunout,*) trim(modname),': AP '
    201   write(lunout,*)  ap
     197  WRITE(lunout,*) trim(modname),': BP '
     198  WRITE(lunout,*)  bp
     199  WRITE(lunout,*) trim(modname),': AP '
     200  WRITE(lunout,*)  ap
    202201
    203202  ! Calcul au milieu des couches :
     
    214213  ENDDO
    215214
    216   if (hybrid) then
     215  if (hybrid) THEN
    217216     aps(llm) = aps(llm-1)**2 / aps(llm-2)
    218217     bps(llm) = 0.5*(bp(llm) + bp(llm+1))
     
    222221  end if
    223222
    224   write(lunout,*) trim(modname),': BPs '
    225   write(lunout,*)  bps
    226   write(lunout,*) trim(modname),': APs'
    227   write(lunout,*)  aps
     223  WRITE(lunout,*) trim(modname),': BPs '
     224  WRITE(lunout,*)  bps
     225  WRITE(lunout,*) trim(modname),': APs'
     226  WRITE(lunout,*)  aps
    228227
    229228  DO l = 1, llm
     
    232231  ENDDO
    233232
    234   write(lunout,*)trim(modname),' : PRESNIVS'
    235   write(lunout,*)presnivs
    236   write(lunout,*)'Pseudo altitude of Presnivs : (for a scale ', &
     233  WRITE(lunout,*)trim(modname),' : PRESNIVS'
     234  WRITE(lunout,*)presnivs
     235  WRITE(lunout,*)'Pseudo altitude of Presnivs : (for a scale ', &
    237236        'height of ',scaleheight,' km)'
    238   write(lunout,*)pseudoalt
     237  WRITE(lunout,*)pseudoalt
    239238
    240239  ! --------------------------------------------------
     
    252251  !   do l=2,llm
    253252  ! approximation of scale height for Venus
    254   !      if (zsig(l-1).le.55.) then
     253  !      if (zsig(l-1).le.55.) THEN
    255254  !         scaleheight = 15.5 - zsig(l-1)/55.*10.
    256255  !      else
     
    260259  !    .    log((aps(l) + bps(l)*ps)/(aps(l-1) + bps(l-1)*ps))
    261260  !   END DO
    262   !   write(53,'(I3,50F10.5)') iz, zsig
     261  !   WRITE(53,'(I3,50F10.5)') iz, zsig
    263262  !  END DO
    264263  !  close(53)
     
    296295
    297296  IMPLICIT NONE
    298   real :: x1, x2, sig,pa,preff, newsig, F
    299   integer :: j
     297  REAL :: x1, x2, sig,pa,preff, newsig, F
     298  INTEGER :: j
    300299
    301300  newsig = sig
    302301  x1=0
    303302  x2=1
    304   if (sig>=1) then
     303  if (sig>=1) THEN
    305304        newsig= sig
    306   else if (sig*preff/pa>=0.25) then
     305  else if (sig*preff/pa>=0.25) THEN
    307306    DO J=1,9999  ! nombre d''iteration max
    308307      F=((1 -pa/preff)*exp(1-1./newsig**2)+(pa/preff)*newsig)/sig
    309       ! write(0,*) J, ' newsig =', newsig, ' F= ', F
    310       if (F>1) then
     308      ! WRITE(0,*) J, ' newsig =', newsig, ' F= ', F
     309      if (F>1) THEN
    311310          X2 = newsig
    312311          newsig=(X1+newsig)*0.5
     
    319318      IF(abs(10.*log(F))<1.E-5) goto 999
    320319    END DO
    321    else   !    if (sig*preff/pa.le.0.25) then
     320   else   !    if (sig*preff/pa.le.0.25) THEN
    322321         newsig= sig*preff/pa
    323322   end if
Note: See TracChangeset for help on using the changeset viewer.