Ignore:
Timestamp:
May 17, 2024, 11:30:17 AM (6 months ago)
Author:
llange
Message:

Mars PCM
Fixing a bug in vdif_cd: a "residual", used as criterion to enter an iterative loop, was wrongly initialized. Hence, for some points, the algorithm does not go into the loop, and a wrong value of Cd, Ch was computed.
Also some cleaning/small fixing with save variables with OMP.

LL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/vdif_cd_mod.F90

    r3325 r3333  
    157157      pcdh(:,:) = 0.
    158158      z0t(:,:) = 0.
     159      fm(:,:) = 0.
     160      fh(:,:) = 0.
    159161      f_ri_cd_min = 0.01
    160162! this formulation assumes alphah=1., implying betah=betam
     
    203205            DO ig=1,ngrid
    204206               ite = 0.
    205                residual = abs(pz0tcomp(ig)-pz0t)
     207               residual = 100*tol_iter*pz0(ig)
    206208               z1z0=pz(ig,1)/pz0(ig)
    207209               cdn(ig)=karman/log(z1z0)
    208210               cdn(ig)=cdn(ig)*cdn(ig)
    209            
    210211               DO WHILE((residual .gt. tol_iter*pz0(ig)) .and.  (ite .lt. itemax))
    211212! Computations of z0T; iterated until z0T converges 
     
    225226                      rib_dry(ig,islope) = ric_colaitis
    226227                   ENDIF
    227        
    228228! Compute the stability functions fm; fh depending on the stability of the surface layer
    229229
Note: See TracChangeset for help on using the changeset viewer.