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 5989 for branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistofcoupled.c – NEMO

Ignore:
Timestamp:
2015-12-03T09:10:32+01:00 (8 years ago)
Author:
deazer
Message:

Merging TMB and 25h diagnostics to head of trunk
added brief documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistofcoupled.c

    r2528 r5989  
    4040 
    4141/******************************************************************************/ 
    42 /*                          varisallocatable_0                                */ 
     42/*                          variscoupled_0                                    */ 
    4343/******************************************************************************/ 
    4444/* Firstpass 0                                                                */ 
     
    4646/*                                                                            */ 
    4747/******************************************************************************/ 
    48 int variscoupled_0(char *ident) 
     48int variscoupled_0(const char *ident) 
    4949{ 
    50    listallocate *newvaralloc; 
    51   listvarpointtovar *pointtmplist;  
    52   listcouple *coupletmp;    
    53   int out; 
    54  
    55    out =0; 
    56    if (firstpass == 0 ) 
    57    { 
    58   pointtmplist = List_CouplePointed_Var; 
    59   while ( pointtmplist && out == 0) 
    60   { 
    61       coupletmp = pointtmplist->t_couple; 
    62       while ( coupletmp && out == 0) 
    63       { 
    64            /* we should find the same variable name in the same subroutine    */ 
    65            if ( !strcasecmp(ident,coupletmp->c_namevar) && 
    66                 !strcasecmp(subroutinename, 
    67                                        pointtmplist->t_cursubroutine) && 
    68                  strcasecmp(coupletmp->c_namepointedvar,"") 
    69               ) 
    70            { 
    71               out = 1; 
    72            } 
    73          coupletmp = coupletmp->suiv; 
    74      } 
    75      pointtmplist = pointtmplist->suiv; 
    76    } 
    77    } 
    78    return out; 
     50    listvarpointtovar *pointtmplist;  
     51    listcouple *coupletmp;    
     52    int out = 0; 
     53     
     54    if (firstpass == 0 ) 
     55    { 
     56        pointtmplist = List_CouplePointed_Var; 
     57        while ( pointtmplist && out == 0) 
     58        { 
     59            coupletmp = pointtmplist->t_couple; 
     60            while ( coupletmp && out == 0) 
     61            { 
     62                /* we should find the same variable name in the same subroutine    */ 
     63                if ( !strcasecmp(ident, coupletmp->c_namevar) && 
     64                     !strcasecmp(subroutinename, pointtmplist->t_cursubroutine) && 
     65                      strcasecmp(coupletmp->c_namepointedvar, "") ) 
     66                { 
     67                    out = 1; 
     68                } 
     69                coupletmp = coupletmp->suiv; 
     70            } 
     71            pointtmplist = pointtmplist->suiv; 
     72        } 
     73    } 
     74    return out; 
    7975} 
    8076 
    81 char * getcoupledname_0(char *ident) 
     77const char * getcoupledname_0(const char *ident) 
    8278{ 
    83    listallocate *newvaralloc; 
    84   listvarpointtovar *pointtmplist;  
    85   listcouple *coupletmp;    
    86   int out; 
    87  
    88    out =0; 
    89    if (firstpass == 0 ) 
    90    { 
    91   pointtmplist = List_CouplePointed_Var; 
    92   while ( pointtmplist && out == 0) 
    93   { 
    94       coupletmp = pointtmplist->t_couple; 
    95       while ( coupletmp && out == 0) 
    96       { 
    97            /* we should find the same variable name in the same subroutine    */ 
    98            if ( !strcasecmp(ident,coupletmp->c_namevar) && 
    99                 !strcasecmp(subroutinename, 
    100                                        pointtmplist->t_cursubroutine) && 
    101                  strcasecmp(coupletmp->c_namepointedvar,"") 
    102               ) 
    103            { 
    104               return(coupletmp->c_namepointedvar); 
    105            } 
    106          coupletmp = coupletmp->suiv; 
    107      } 
    108      pointtmplist = pointtmplist->suiv; 
    109    } 
    110    } 
     79    listvarpointtovar *pointtmplist;  
     80    listcouple *coupletmp;    
     81    int out = 0; 
     82     
     83    if (firstpass == 0 ) 
     84    { 
     85        pointtmplist = List_CouplePointed_Var; 
     86        while ( pointtmplist && out == 0) 
     87        { 
     88            coupletmp = pointtmplist->t_couple; 
     89            while ( coupletmp && out == 0) 
     90            { 
     91                /* we should find the same variable name in the same subroutine    */ 
     92                if ( !strcasecmp(coupletmp->c_namevar,ident) && 
     93                     !strcasecmp(pointtmplist->t_cursubroutine,subroutinename) && 
     94                      strcasecmp(coupletmp->c_namepointedvar,"") ) 
     95                { 
     96                    return coupletmp->c_namepointedvar; 
     97                } 
     98                coupletmp = coupletmp->suiv; 
     99            } 
     100            pointtmplist = pointtmplist->suiv; 
     101        } 
     102    } 
     103    printf("end of getcoupledname_0 -- you should not be there !!! \n"); 
     104    return NULL; 
    111105} 
Note: See TracChangeset for help on using the changeset viewer.