source: trunk/LMDZ.TITAN/libf/chimtitan/check.c @ 3094

Last change on this file since 3094 was 1908, checked in by jvatant, 7 years ago

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

File size: 1.6 KB
Line 
1/* Sanity check routine about coherence between C and Fortran parameters for chemistry */
2/* Author : Jan Vatant d'Ollone - 2018 */
3
4#include "titan.h"
5
6void check_(
7     int *NLEV_fort, int *NLD_fort,
8     int *NLRT_fort, int *NC_fort   )
9{
10
11   if( (*NLEV_fort) != NLEV )
12   {
13    printf("\n");
14    printf("!! Coherence problem between C and Fortran !!\n");
15    printf("In C, NLEV=%d whereas in Fortran nlaykim_tot=%d\n",NLEV,*(NLEV_fort));
16    printf("You surely didn't modified titan.h according to your startfile ! \n");
17    printf("I abort ...\n");
18    exit(0);
19   }
20
21   if( (*NLD_fort) != NLD )
22   {
23    printf("\n");
24    printf("!! Coherence problem between C and Fortran !!\n");
25    printf("The number of levels with diffusion must be Numbers-of-levels-of-GCM minus 15 !\n");
26    printf("In C, NLD=%d whereas in Fortran klev-15=%d\n",NLD,*(NLD_fort));
27    printf("You surely didn't modified titan.h according to your startfile ! \n");
28    printf("I abort ...\n");
29    exit(0);
30   }
31
32   if( (*NLRT_fort) != NLRT )
33   {
34    printf("\n");
35    printf("!! Coherence problem between C and Fortran for the number of UV levels !!\n");
36    printf("In C in titan.h, NLRT=%d whereas in Fortran comchem_h, nlrt_kim=%d\n",NLRT,*(NLRT_fort));
37    printf("I abort ...\n");
38    exit(0);
39   }
40
41   if( (*NC_fort) != NC )
42   {
43    printf("\n");
44    printf("!! Coherence problem between C and Fortran for number of compounds !!\n");
45    printf("In C, NC=%d whereas in Fortran nkim=%d\n",NC,*(NC_fort));
46    printf("You have maybe changed the chemistry but running with old startfiles ! \n");
47    printf("I abort ...\n");
48    exit(0);
49   }
50
51}
Note: See TracBrowser for help on using the repository browser.