New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5948 for branches/2014/dev_r4650_UKMO12_CFL_diags_take2/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFile.c – NEMO

Ignore:
Timestamp:
2015-11-30T11:47:24+01:00 (8 years ago)
Author:
timgraham
Message:

Merged in head of trunk (r5936)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO12_CFL_diags_take2/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFile.c

    r5947 r5948  
    4040 
    4141/******************************************************************************/ 
    42 /*                            associate                                       */ 
     42/*                         open_for_write                                     */ 
    4343/******************************************************************************/ 
    4444/* This subroutine is used to open a file                                     */ 
    4545/******************************************************************************/ 
    46 FILE * associate (char *filename) 
     46FILE* open_for_write (const char *filename) 
    4747{ 
    48   char filefich[LONG_C]; 
    49   sprintf(filefich,"%s/%s",nomdir,filename); 
    50   return fopen (filefich, "w"); 
     48    char filefich[LONG_FNAME]; 
     49    sprintf(filefich,"%s/%s",include_dir,filename); 
     50    return fopen(filefich, "w"); 
    5151} 
    5252 
    53  
    5453/******************************************************************************/ 
    55 /*                          associateaplus                                    */ 
     54/*                          open_for_append                                   */ 
    5655/******************************************************************************/ 
    5756/* This subroutine is used to open a file with option a+                      */ 
    5857/******************************************************************************/ 
    59 FILE * associateaplus (char *filename) 
     58FILE* open_for_append (const char *filename) 
    6059{ 
    61   char filefich[LONG_C]; 
    62   sprintf(filefich,"%s/%s",nomdir,filename); 
    63   return fopen (filefich, "a+"); 
     60    char filefich[LONG_M]; 
     61    sprintf(filefich,"%s/%s",include_dir,filename); 
     62    return fopen(filefich, "a+"); 
    6463} 
    6564 
    66  
    6765/******************************************************************************/ 
    68 /*                           setposcurname                                       */ 
     66/*                           setposcurname                                    */ 
    6967/******************************************************************************/ 
    7068/* This subroutine is used to know the current position in the file in argument    */ 
     
    7674long int setposcurname(FILE *fileout) 
    7775{ 
    78    fflush(fileout); 
    79    return ftell(fileout); 
     76    fflush(fileout); 
     77    return ftell(fileout); 
    8078} 
    8179 
     
    9189long int setposcur() 
    9290{ 
    93    fflush(fortranout); 
    94    return ftell(fortranout); 
    95 } 
    96  
    97 /******************************************************************************/ 
    98 /*                      setposcurinoldfortranout                              */ 
    99 /******************************************************************************/ 
    100 /* This subroutine is used to know the position in the oldfortranout         */ 
    101 /******************************************************************************/ 
    102 /*                                                                            */ 
    103 /*             setposcurinoldfortranout ---------> position in file           */ 
    104 /*                                                                            */ 
    105 /******************************************************************************/ 
    106 long int setposcurinoldfortranout() 
    107 { 
    108    fflush(oldfortranout); 
    109    return ftell(oldfortranout); 
     91    return setposcurname(fortran_out); 
    11092} 
    11193 
     
    11496/******************************************************************************/ 
    11597/* Firstpass 0                                                                */ 
    116 /* We should write in the fortranout the USE tok_name                         */ 
     98/* We should write in the fortran_out the USE tok_name                         */ 
    11799/* read in the original file                                                  */ 
    118100/******************************************************************************/ 
    119101/*                                                                            */ 
    120102/******************************************************************************/ 
    121 void copyuse_0(char *namemodule) 
     103void copyuse_0(const char *namemodule) 
    122104{ 
    123    if (firstpass == 0 && IsTabvarsUseInArgument_0() == 1 ) 
    124    { 
    125       /* We should write this declaration into the original subroutine too    */ 
    126       fprintf(oldfortranout,"      USE %s \n",namemodule); 
    127    } 
     105    if ( IsTabvarsUseInArgument_0() == 1 ) 
     106    { 
     107        /* We should write this declaration into the original subroutine too    */ 
     108        fprintf(oldfortran_out,"      use %s\n", namemodule); 
     109    } 
    128110} 
    129111 
     
    132114/******************************************************************************/ 
    133115/* Firstpass 0                                                                */ 
    134 /* We should write in the fortranout the USE tok_name, only                   */ 
     116/* We should write in the fortran_out the USE tok_name, only                   */ 
    135117/* read in the original file                                                  */ 
    136118/******************************************************************************/ 
    137119/*                                                                            */ 
    138120/******************************************************************************/ 
    139 void copyuseonly_0(char *namemodule) 
     121void copyuseonly_0(const char *namemodule) 
    140122{ 
    141123   if (firstpass == 0 && IsTabvarsUseInArgument_0() == 1 ) 
    142124   { 
    143125      /* We should write this declaration into the original subroutine too    */ 
    144       fprintf(oldfortranout,"      USE %s , ONLY : \n",namemodule); 
     126      fprintf(oldfortran_out,"      use %s , only : \n", namemodule); 
    145127   } 
    146128} 
Note: See TracChangeset for help on using the changeset viewer.