Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:38:31 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
bf4be02920 Jean*0001 !=======================================================================
                0002       integer function mitcplr_match_comp( carg )
                0003       implicit none
                0004 ! Predefined constants/arrays
                0005 #include "CPLR_SIG.h"
                0006 ! Arguments
                0007       character*(*) carg
                0008 ! Local
                0009       integer j,jmatch
                0010 !     ------------------------------------------------------------------
                0011 
                0012       if ( carg .EQ. coupler_Name ) then
                0013        mitcplr_match_comp=-1
                0014        stop 'mitcplr_match_comp: I should not reach this point'
                0015       else
                0016 
                0017 ! Search through list of components
                0018       jmatch=0
                0019       do j=1,num_components
                0020        if ( carg .EQ. component_List(j) ) then
                0021         if ( jmatch .NE. 0 ) then
                0022          if (DEBUG) write(0,*) 'mitcplr_match_comp: String arg = ',carg
                0023          stop 'mitcplr_match_comp: More than one match to string'
                0024         else
                0025          jmatch=j
                0026         endif
                0027        endif
                0028       enddo
                0029 
                0030 ! If no matches, create entry in list
                0031       if ( jmatch .EQ. 0) then
                0032        if ( num_components .EQ. MAX_COMPONENTS ) then
                0033         stop 'mitcplr_match_comp: Too many components types entered'
                0034        endif
                0035        num_components=num_components+1
                0036        jmatch=num_components
                0037        call mitcplr_initcomp( jmatch, carg )
                0038       endif
                0039 
                0040 ! Return index within list
                0041       mitcplr_match_comp=jmatch
                0042 
                0043       endif
                0044 
                0045 !     ------------------------------------------------------------------
                0046       return
                0047       end
                0048 !=======================================================================