Ignore:
Timestamp:
Mar 8, 2018, 5:16:35 PM (7 years ago)
Author:
jvatant
Message:

Making chemistry handling more flexible - Major and Final Step (hopefully) !
After preliminary commits r1871-86-87-91-94-98, here comes the major update of the interface
with photochemical module + fix how tendencies for chem and mufi tracers are managed in physiq_mod !
+ Major modifs in :
++ calchim.F90 to comply with flexible resolution, parallelism, upper pressure grid ...
++ physiq_mod.F90 where there was a bug on the update of the tracers and their tendencies for calchim

and calmufi ( we actually were sending non-updated fields to these processes )
We also now put the same tendency on all longitudes within a lat band and not
relative tendency if 2D chemistry ( and we set to zero if ever negs are created )

+ Also modifs to have chemistry in 1D in rcm1d ( and moved gr_kim_vervack in phytitan to be accessible for 1d )
+ In chemistry added a check.c to verify coherence of sizes between C and Fortran
--JVO

Location:
trunk/LMDZ.TITAN/libf/chimtitan
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/chimtitan/gptitan.c

    r1126 r1908  
    11/* gptitan: photochimie */
    22/* GCCM */
    3 
    4 /* tout est passe en simple precision */
    5 /* sauf pour l'inversion de la matrice */
    63
    74/* nitriles et hydrocarbures separes pour l'inversion */
     
    1411     double *RA, double *TEMP, double *NB,
    1512     char CORPS[][10], double Y[][NLEV],
    16      double *FIN, int *LAT, double *MASS, double MD[][NLEV],
     13     double *FIN, double *LAT, double *MASS, double MD[][NLEV],
    1714     double *KEDD, double *botCH4, double KRATE[][NLEV],
    1815     int reactif[][5], int *nom_prod, int *nom_perte,
     
    5350
    5451/* DEBUG */
    55       printf("CHIMIE: lat=%d\n",(*LAT)+1);
     52      printf("CHIMIE: lat=%g\n",(*LAT));
    5653/**/
    5754
     
    6562   strcat( outlog, ".log" );
    6663   out = fopen( outlog, "w" );
    67    fprintf(out,"CHIMIE: lat=%d\n",(*LAT)+1);
     64   fprintf(out,"CHIMIE: lat=%g\n",(*LAT));
    6865   fclose( out );
    6966
     
    7976/*  DEBUG
    8077            out = fopen( outlog, "a" );
    81    fprintf(out,"CHIMIE: lat=%d\n",(*LAT)+1);
     78   fprintf(out,"CHIMIE: lat=%g\n",(*LAT));
    8279            fclose( out );
    8380*/
     
    236233             }
    237234/* DEBUG
    238 printf("AERPROD : LAT = %d - J = %d\n",(*LAT),j);
     235printf("AERPROD : LAT = %g - J = %d\n",(*LAT),j);
    239236if(fabs(dyc2h2*NB[j])>fabs(fp[utilaer[2]]/10.))
    240237      printf("fp(%s) =%e; dyc2h2 =%e\n",corps[utilaer[2]],
     
    286283
    287284/* DEBUG
    288 printf("HTOH2 : LAT = %d - J = %d\n",(*LAT),j);
     285printf("HTOH2 : LAT = %g - J = %d\n",(*LAT),j);
    289286if(fabs(dyh*NB[j])>fabs(fp[utilaer[0]]/10.))
    290287printf("fp(%s) = %e; dyh  = %e\n",corps[utilaer[0]],fp[utilaer[0]],dyh*NB[j]);
     
    511508                  {
    512509                     out = fopen( outlog, "a" );
    513                      fprintf( out, "Lat no %d;", (*LAT)+1);
     510                     fprintf( out, "Latitude %g;", (*LAT));
    514511                     fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0),corps[i],ym1[i],Y[i][j],time,delta);
    515512                     fclose( out );
     
    666663             }
    667664/* DEBUG
    668 printf("AERPROD : LAT = %d - J = %d\n",(*LAT),j);
     665printf("AERPROD : LAT = %g - J = %d\n",(*LAT),j);
    669666if(fabs(dyc2h2*NB[j])>fabs(fp[utilaer[2]]/10.))
    670667      printf("fp(%s) =%e; dyc2h2 =%e\n",corps[utilaer[2]],
     
    716713
    717714/* DEBUG
    718 printf("HTOH2 : LAT = %d - J = %d\n",(*LAT),j);
     715printf("HTOH2 : LAT = %g - J = %d\n",(*LAT),j);
    719716if(fabs(dyh*NB[j])>fabs(fp[utilaer[0]]/10.))
    720717printf("fp(%s) = %e; dyh  = %e\n",corps[utilaer[0]],fp[utilaer[0]],dyh*NB[j]);
     
    810807                  {
    811808                     out = fopen( outlog, "a" );
    812                      fprintf( out, "Lat no %d; declin:%e;", (*LAT)+1, (*DECLIN) );
     809                     fprintf( out, "Latitude: %g; declin:%e;", (*LAT), (*DECLIN) );
    813810                     fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0),corps[i],ym1[i],Y[i][j],time,delta);
    814811                     fclose( out );
  • trunk/LMDZ.TITAN/libf/chimtitan/titan.h

    r1126 r1908  
    77
    88#define R0    (double)(2575.0) /* Titan's radius */
    9 #define NLEV  (int)(125)  /* Nbre de niv verticaux - =llm+70 dans common_mod */
    10 #define NLD   (int)(40)   /* Nbre de niv verticaux faits sans diff */
     9#define NLEV  (int)(133)  /* Nbre de niv verticaux - =llm+70 dans common_mod -> Need to be coherent with the vertical grid used !! */
     10#define NLD   (int)(40)   /* Nbre de niv verticaux faits sans diff -> Need to be coherent with the vertical grid used !! */
    1111#define NLRT  (int)(650)  /* Nbre de niv verticaux dans table fmoy - aussi dans common_mod */
    1212
Note: See TracChangeset for help on using the changeset viewer.