Skip to content

Commit

Permalink
Update RPN-SI libraries and tools
Browse files Browse the repository at this point in the history
  • Loading branch information
chantal-pic committed Jan 9, 2024
1 parent 1a5bd80 commit 426c67b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 32 deletions.
56 changes: 31 additions & 25 deletions src/rpn-si/cclargs/cclargs_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ struct definition
enum typecle type;
};


check_argv(char **argv){
if(*argv != NULL) return;
fprintf(stderr,"cclargs: FATAL ERROR, argument expected, NULL found\n");
exit(1);
}

main(argc, argv)
int argc;
char **argv;
Expand All @@ -83,36 +88,41 @@ char **argv;

for(i = 0; i < NKLEMAX ; i++)
{
defo[i].kle_nom=defo[i].kle_def1=defo[i].kle_def2=defo[i].kle_val=defo[i].kle_desc=NULL;
defo[i].kle_nom=NULL;
defo[i].kle_def1=defo[i].kle_def2=defo[i].kle_val=defo[i].kle_desc="";
}

argv++; /* on saute le nom du programme */
argv++ ; check_argv(argv); /* on saute le nom du programme */
if( ! strcmp(*argv,"-NOUI") )
{
argv++;
argv++ ; check_argv(argv);
UI=0;
}
if( ! strcmp(*argv,"-D") )
{
argv++;
argv++ ; check_argv(argv);
delimiter=**argv;
fprintf(stderr,"Changing multi-value argument delimiter from : to %c\n",delimiter);
argv++;
fprintf(stderr,"Changing multi-value argument delimiter from : to ");
if (delimiter != '\0')
fprintf(stderr,"%c\n",delimiter);
else
fprintf(stderr,"(null)\n");
argv++ ; check_argv(argv);
}
if( ! strcmp(*argv,"-python") )
{
interp=python;
argv++;
argv++ ; check_argv(argv);
}
if( ! strcmp(*argv,"-perl") )
{
interp=perl;
argv++;
argv++ ; check_argv(argv);
}
if(**argv != '-')
{
getnom(scriptnom,*argv,49);
argv++;
argv++ ; check_argv(argv);
}
else
{
Expand All @@ -125,18 +135,17 @@ char **argv;
if(! strcmp(*argv,"-+"))
{
on_affiche = 1;
argv++;
argv++ ; check_argv(argv);
}

/*
*verifier s'il y a un help general pour le script
*/
if(**argv == '[')
{
lng = strlen(*argv)-1;
*((*argv)+lng) = '\0';
strcpy(help_general,(*argv)+1);
argv++;
lng = strlen(*argv)-2;
strncpy(help_general,(*argv)+1,lng);
argv++ ; check_argv(argv);
}

/* dresser la liste des arguments et leurs valeurs de defaut */
Expand All @@ -153,13 +162,13 @@ char **argv;
{
if(!strcmp(*pointeur,"--help"))
{
sequence_appel(defo,scriptnom);
sequence_appel(defo,scriptnom,help_general);
printf(" exit 0 ;");
exit (0);
}
if(!strcmp(*pointeur,"-h"))
{
sequence_appel(defo,scriptnom);
sequence_appel(defo,scriptnom,help_general);
printf(" exit 0 ;");
exit (0);
}
Expand Down Expand Up @@ -199,7 +208,7 @@ if(interp== shell) {
if(status !=0)
{
printf(" exit %d ",status);
sequence_appel(defo,scriptnom);
sequence_appel(defo,scriptnom,help_general);
exit (status);
}

Expand All @@ -217,7 +226,6 @@ if(interp== shell) {
#ifndef NOUI
interactif(defo,scriptnom,help_general);
#else
/*sprintf(OUTBUF,"cclargs_lite_curses_%3.3d",VERSION);*/
sprintf(OUTBUF,"cclargs_lite_curses");
/* fprintf(stderr,"Exec to %s\n",OUTBUF); */
if(UI){
Expand Down Expand Up @@ -347,11 +355,8 @@ int *status;
{
if(**argv == '[') /* descripteur pour help */
{
/* add extra blank to the end so there is no char trunc */
ldesc = strlen(*argv) - 1 ;
defo[i].kle_desc = malloc((ldesc+1)*sizeof(char));
*((*argv)+ldesc) = ' ';
ldesc++;
defo[i].kle_desc = malloc(ldesc*sizeof(char));
*((*argv)+ldesc) = '\0';
strcpy(defo[i].kle_desc,(*argv)+1);
}
Expand Down Expand Up @@ -739,9 +744,10 @@ char *arg;
* imprimer sur stderr la sequence d'appel *
******************************************************/

void sequence_appel(defo,scriptnom)
void sequence_appel(defo,scriptnom,help_general)
struct definition defo[];
char *scriptnom;
char *help_general;

/* fonction servant a imprimer sur le fichier stderr la liste des
* noms de clefs et leurs valeurs de defaut
Expand All @@ -760,7 +766,7 @@ char *scriptnom;

fprintf(stderr,"\n *** SEQUENCE D'APPEL ***\n\n");

fprintf(stderr,"%s [positionnels]\n",scriptnom);
fprintf(stderr,"%s [positionnels] %s\n",scriptnom,help_general);

while(defo[i].kle_nom != '\0')
{
Expand Down
4 changes: 3 additions & 1 deletion src/rpn-si/filetype/filetyp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ program filetyp
implicit none
character *8 cle(10)
character *4096 def(10),val(10)
character *60 msgs(-1:37)
character *60 msgs(-1:39)
integer wkoffit,ipos,ier,t(8),i

data cle /'L ',8*'T','-.'/
Expand Down Expand Up @@ -49,6 +49,8 @@ program filetyp
data msgs(35) /'FICHIER NETCDF'/
data msgs(36) /'FICHIER CMCARC v4'/
data msgs(37) /'FICHIER CMCARC v5'/
data msgs(38) /'FICHIER HDF5'/
data msgs(39) /'RPN standard 98 with RSF backend'/

ipos = 0
call ccard (cle,def,val,10,ipos)
Expand Down
2 changes: 1 addition & 1 deletion src/rpn-si/rmn
Submodule rmn updated 44 files
+128 −58 .gitlab-ci.yml
+1 −1 App
+19 −30 CHANGELOG_en.md
+28 −41 CHANGELOG_fr.md
+15 −12 README.md
+1 −1 cmake_rpn
+8 −0 src/PUBLIC_INCLUDES/rmn.h
+8 −0 src/PUBLIC_INCLUDES/rmn/DlInterface.h
+10 −0 src/PUBLIC_INCLUDES/rmn/burp.h
+7 −0 src/PUBLIC_INCLUDES/rmn/c_ccard.h
+8 −0 src/PUBLIC_INCLUDES/rmn/c_wkoffit.h
+8 −0 src/PUBLIC_INCLUDES/rmn/cpu_type.h
+8 −0 src/PUBLIC_INCLUDES/rmn/excdes_new.h
+8 −0 src/PUBLIC_INCLUDES/rmn/ezscint.h
+8 −0 src/PUBLIC_INCLUDES/rmn/fnom.h
+8 −0 src/PUBLIC_INCLUDES/rmn/fst_missing.h
+12 −0 src/PUBLIC_INCLUDES/rmn/fstd98.h
+8 −0 src/PUBLIC_INCLUDES/rmn/ftn2c_helper.h
+8 −0 src/PUBLIC_INCLUDES/rmn/ftnStrLen.h
+8 −0 src/PUBLIC_INCLUDES/rmn/gossip.h
+2 −2 src/PUBLIC_INCLUDES/rmn/gossip_constants.h
+8 −0 src/PUBLIC_INCLUDES/rmn/plugins.h
+7 −0 src/PUBLIC_INCLUDES/rmn/swap_buffer.h
+142 −0 src/base/sll.F
+76 −0 src/base/vll.F
+1 −1 src/fstd98/fstd98.c
+23 −20 src/fstd98/xdf98.c
+68 −0 src/spectral/alpas2.F
+50 −0 src/spectral/alpdr2.F
+69 −0 src/spectral/alpnm2.F
+76 −0 src/spectral/dimcal.F
+50 −0 src/spectral/epsil2.F
+66 −0 src/spectral/ewfdr2.F
+94 −0 src/spectral/fasp2.F
+95 −0 src/spectral/spaf2.F
+11 −5 src/whiteboard/WhiteBoard_c.c
+1 −0 src/whiteboard/WhiteBoard_constants.h
+0 −3 src/whiteboard/test/Makefile
+0 −36 src/whiteboard/test/WhiteBoard_proto.h
+26 −1 tests/CMakeLists.txt
+8 −2 tests/wb_get.c
+7 −4 tests/wb_putget.F90
+30 −0 tests/wb_test.F90
+69 −12 tests/wb_test.c
2 changes: 1 addition & 1 deletion src/rpn-si/rpncomm
2 changes: 1 addition & 1 deletion src/rpn-si/tdpack
Submodule tdpack updated 5 files
+95 −27 .gitlab-ci.yml
+9 −9 CMakeLists.txt
+9 −33 Config.cmake.in
+1 −1 MANIFEST
+1 −1 cmake_rpn
2 changes: 1 addition & 1 deletion src/rpn-si/vgrid

0 comments on commit 426c67b

Please sign in to comment.