Back to home page

darwin3

 
 

    


File indexing completed on 2025-09-13 12:07:55 UTC

view on githubraw file Latest commit 13ce79fe on 2025-08-04 21:05:34 UTC
1ff0163ead Gael*0001 #include "PROFILES_OPTIONS.h"
                0002 
13ce79fe94 Ivan*0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
1ff0163ead Gael*0004 CBOP
13ce79fe94 Ivan*0005 C !ROUTINE: PROFILES_INI_IO
                0006 
                0007 C !INTERFACE:
1ff0163ead Gael*0008       SUBROUTINE PROFILES_INI_IO( myThid )
                0009 
13ce79fe94 Ivan*0010 C     !DESCRIPTION:
                0011 C     Create directory for profiles output if needed
1ff0163ead Gael*0012 
13ce79fe94 Ivan*0013 C     !USES:
1ff0163ead Gael*0014       IMPLICIT NONE
13ce79fe94 Ivan*0015 C     == Global variables ===
1ff0163ead Gael*0016 #include "SIZE.h"
                0017 #include "EEPARAMS.h"
                0018 #include "EESUPPORT.h"
                0019 #include "PARAMS.h"
6328b73337 Gael*0020 #include "PROFILES_SIZE.h"
1ff0163ead Gael*0021 #include "profiles.h"
                0022 
                0023 C     !INPUT/OUTPUT PARAMETERS:
13ce79fe94 Ivan*0024 C     myThid: my thread ID number
1ff0163ead Gael*0025       INTEGER myThid
13ce79fe94 Ivan*0026 CEOP
1ff0163ead Gael*0027 
13ce79fe94 Ivan*0028 C     !FUNCTIONS:
1ff0163ead Gael*0029       INTEGER  ILNBLNK
                0030       EXTERNAL ILNBLNK
                0031 
                0032 C     !LOCAL VARIABLES:
cbf501ab81 Jean*0033 #ifndef HAVE_SYSTEM
b00d6c1700 Gael*0034       CHARACTER*(MAX_LEN_MBUF) msgBuf
cbf501ab81 Jean*0035 #endif
1ff0163ead Gael*0036       CHARACTER*(MAX_LEN_FNAM) namBuf
                0037       INTEGER iL, pIL
                0038 
b00d6c1700 Gael*0039       _BEGIN_MASTER( myThid )
                0040 
13ce79fe94 Ivan*0041       IF (profilesDir .NE. ' ') THEN
                0042         iL = ILNBLNK( profilesDir )
                0043 C Append "/", if necessary
                0044         IF (iL.LT.MAX_LEN_FNAM .AND. profilesDir(iL:iL).NE.'/') THEN
                0045           namBuf(1:iL) = profilesDir(1:iL)
                0046           WRITE(profilesDir(1:iL+1),'(2A)') namBuf(1:iL),'/'
                0047         ENDIF
70dd91cc56 Gael*0048 #ifdef HAVE_SYSTEM
13ce79fe94 Ivan*0049 C Create directory
                0050         iL = ILNBLNK( profilesDir ) -1
                0051         WRITE(namBuf,'(2A)') ' mkdir -p ', profilesDir(1:iL)
                0052         pIL = 1 + ILNBLNK( namBuf )
                0053         WRITE(standardMessageUnit,'(3A)')
                0054      &  '==> SYSTEM CALL (from PROFILES_INI_IO): >',namBuf(1:pIL),'<'
                0055         CALL SYSTEM( namBuf(1:pIL) )
70dd91cc56 Gael*0056 #else
13ce79fe94 Ivan*0057         WRITE(msgBuf,'(2A)') '** WARNING ** PROFILES_INI_IO: cannot ',
                0058      &   'call mkdir -> please create profilesDir manually'
                0059         CALL PRINT_MESSAGE( msgBuf,
                0060      &       errorMessageUnit, SQUEEZE_RIGHT, myThid )
70dd91cc56 Gael*0061 #endif
1ff0163ead Gael*0062       ENDIF
                0063 
b00d6c1700 Gael*0064       _END_MASTER( myThid )
                0065 
1ff0163ead Gael*0066       RETURN
                0067       END