Changeset 1965 for trunk/LMDZ.TITAN/libf


Ignore:
Timestamp:
Jul 5, 2018, 4:25:51 PM (6 years ago)
Author:
jvatant
Message:

Replace Numerical Recipes "solve.c" in C chemistry by "solve_lapack.c" call to Lapack dgesv
-> ~60 times quicker ( quasi-instantaneous now )
--JVO

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

Legend:

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

    r1958 r1965  
    5151  /* DEBUG */
    5252  printf("CHIMIE: lat=%g\n",(*LAT));
     53  /**/
     54
     55  /* Warning about computational time */
     56#ifndef LAPACK
     57  printf("Hey there !! LAPACK key is turned off, the chemistry could be way quicker if you were activating it !\n");
     58#endif
    5359  /**/
    5460
     
    467473      for( j = NLD+1; j <= NLEV-1; j++ )
    468474        {
     475#ifdef LAPACK
     476          solve_lapack( a, j-1, 0, ST-1 );
     477#else
    469478          solve( a, j-1, 0, ST-1 );
     479#endif
    470480          for( i = 0; i <= ST-1; i++ )
    471481            {
     
    479489            }
    480490        }
     491#ifdef LAPACK
     492      solve_lapack( a, NLEV-1, 0, ST-1 );
     493#else
    481494      solve( a, NLEV-1, 0, ST-1 );
     495#endif
    482496      for( j = NLEV-1; j >= NLD; j-- )     
    483497        {
  • trunk/LMDZ.TITAN/libf/chimtitan/titan.h

    r1950 r1965  
    77
    88#define R0    (double)(2575.0) /* Titan's radius */
    9 #define NLEV  (int)(133)  /* Nbre de niv verticaux - =llm+70 dans common_mod -> Need to be coherent with the vertical grid used !! */
     9#define NLEV  (int)(133)  /* Nbre de niv verticaux -> Need to be coherent with the vertical grid used !! */
    1010#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 */
     
    4040double omega( double, double, double );
    4141void  solve( double ***, int, int, int );
     42void  solve_lapack( double ***, int, int, int );
    4243void  solve_b( double ***, double **, int, int, int );
    4344float *rm1d( int, int );
Note: See TracChangeset for help on using the changeset viewer.