00001 !=============================================================================== 00002 ! SVN $Id: shr_msg_mod.F90 6752 2007-10-04 21:02:15Z jwolfe $ 00003 ! SVN $URL: https://svn-ccsm-models.cgd.ucar.edu/csm_share/branch_tags/cesm1_0_rel_tags/cesm1_0_rel01_share3_100616/shr/shr_msg_mod.F90 $ 00004 !=============================================================================== 00005 00006 !BOP =========================================================================== 00007 ! 00008 ! !MODULE: shr_msg_mod.F90 --- Module to handle various file utilily functions. 00009 ! 00010 ! !DESCRIPTION: 00011 ! 00012 ! Miscilaneous methods to handle file and directory utilities needed for 00013 ! message passing CCSM. 00014 ! 00015 ! NOTE: 00016 ! 00017 ! This module can be replaced by the direct use of shr_file_mod.F90 as all 00018 ! real functionality was moved to shr_file_mod. 00019 ! 00020 ! !REVISION HISTORY: 00021 ! 2006-05-08 E. Kluzek, move functionality to shr_file_mod.F90. 00022 ! 2000-??-?? B. Kauffman, original version circa 2000 00023 ! 00024 ! !INTERFACE: ------------------------------------------------------------------ 00025 00026 MODULE shr_msg_mod 00027 00028 ! ! USES: 00029 use shr_file_mod ! The real guts of everything here 00030 use shr_log_mod, only: s_loglev => shr_log_Level 00031 use shr_log_mod, only: s_logunit => shr_log_Unit 00032 00033 IMPLICIT none 00034 PRIVATE ! By default everything is private to this module 00035 00036 ! !PUBLIC TYPES: 00037 00038 ! no public types 00039 00040 ! !PUBLIC MEMBER FUNCTIONS: 00041 public :: shr_msg_chDir ! change current working directory 00042 public :: shr_msg_chStdIn ! change stdin (attach to a file) 00043 public :: shr_msg_chStdOut ! change stdout (attach to a file) 00044 public :: shr_msg_stdio ! change dir and stdin and stdout 00045 public :: shr_msg_dirio ! change stdin and stdout 00046 00047 ! !PUBLIC DATA MEMBERS: 00048 00049 ! no public data members 00050 00051 !EOP 00052 00053 !=============================================================================== 00054 CONTAINS 00055 !=============================================================================== 00056 00057 !BOP =========================================================================== 00058 ! 00059 ! !IROUTINE: shr_msg_stdio -- Change working directory, and redirect stdin/stdout 00060 ! 00061 ! !DESCRIPTION: 00062 ! 1) change the cwd (current working directory) and 00063 ! 2) redirect stdin & stdout (units 5 & 6) to named files, 00064 ! where the desired cwd & files are specified by namelist file. 00065 ! 00066 ! !INTERFACE: ------------------------------------------------------------------ 00067 SUBROUTINE shr_msg_stdio(model) 00068 00069 implicit none 00070 00071 ! !INPUT/OUTPUT PARAMETERS: 00072 !--- arguments --- 00073 character(len=*),intent(in) :: model ! used to construct env varible name 00074 !EOP 00075 00076 !------------------------------------------------------------------------------- 00077 ! Notes: 00078 ! 00079 !------------------------------------------------------------------------------- 00080 00081 call shr_file_stdio(model) 00082 00083 END SUBROUTINE shr_msg_stdio 00084 00085 !=============================================================================== 00086 00087 !BOP =========================================================================== 00088 ! 00089 ! !IROUTINE: shr_msg_chdir -- Change working directory. 00090 ! 00091 ! !DESCRIPTION: 00092 ! change the cwd (current working directory), see shr_msg_stdio for notes 00093 ! 00094 ! !INTERFACE: ------------------------------------------------------------------ 00095 00096 SUBROUTINE shr_msg_chdir(model) 00097 00098 ! !USES: 00099 use shr_sys_mod, only: shr_sys_chdir 00100 00101 implicit none 00102 00103 ! !INPUT/OUTPUT PARAMETERS: 00104 !--- arguments --- 00105 character(len=*),intent(in) :: model ! used to construct env varible name 00106 !EOP 00107 00108 !--- local --- 00109 00110 !------------------------------------------------------------------------------- 00111 ! Notes: 00112 ! 00113 !------------------------------------------------------------------------------- 00114 00115 call shr_file_chdir( model ) 00116 00117 END SUBROUTINE shr_msg_chdir 00118 00119 !=============================================================================== 00120 00121 !BOP =========================================================================== 00122 ! 00123 ! !IROUTINE: shr_msg_dirio --- Change stdin and stdout. 00124 ! 00125 ! !DESCRIPTION: 00126 ! change the stdin & stdout (units 5 & 6), see shr_msg_stdio for notes 00127 ! 00128 ! !INTERFACE: ------------------------------------------------------------------ 00129 SUBROUTINE shr_msg_dirio(model) 00130 00131 implicit none 00132 00133 ! !INPUT/OUTPUT PARAMETERS: 00134 !--- arguments --- 00135 character(len=*),intent(in) :: model ! used to construct env varible name 00136 !EOP 00137 00138 !--- local --- 00139 00140 !------------------------------------------------------------------------------- 00141 ! Notes: 00142 ! 00143 !------------------------------------------------------------------------------- 00144 00145 call shr_file_dirio(model) 00146 00147 END SUBROUTINE shr_msg_dirio 00148 00149 !=============================================================================== 00150 00151 !BOP =========================================================================== 00152 ! 00153 ! !IROUTINE: shr_msg_chStdIn -- Change stdin 00154 ! 00155 ! !DESCRIPTION: 00156 ! change the stdin (unit 5), see shr_msg_stdio for notes 00157 ! 00158 ! !INTERFACE: ------------------------------------------------------------------ 00159 SUBROUTINE shr_msg_chStdIn(model) 00160 00161 implicit none 00162 00163 ! !INPUT/OUTPUT PARAMETERS: 00164 !--- arguments --- 00165 character(*),intent(in) :: model ! used to construct env varible name 00166 !EOP 00167 !--- local --- 00168 00169 !------------------------------------------------------------------------------- 00170 ! Notes: 00171 ! 00172 !------------------------------------------------------------------------------- 00173 00174 call shr_file_chStdIn(model) 00175 00176 END SUBROUTINE shr_msg_chStdIn 00177 00178 !=============================================================================== 00179 00180 !BOP =========================================================================== 00181 ! 00182 ! !IROUTINE: shr_msg_stdout -- Change stdout 00183 ! 00184 ! !DESCRIPTION: 00185 ! change the stdout (unit 6), see shr_msg_stdio for notes 00186 ! 00187 ! !INTERFACE: ------------------------------------------------------------------ 00188 00189 SUBROUTINE shr_msg_chStdOut(model) 00190 00191 implicit none 00192 00193 ! !INPUT/OUTPUT PARAMETERS: 00194 !--- arguments --- 00195 character(*),intent(in) :: model ! used to construct env varible name 00196 !EOP 00197 00198 !--- local --- 00199 00200 !------------------------------------------------------------------------------- 00201 ! Notes: 00202 ! 00203 !------------------------------------------------------------------------------- 00204 00205 call shr_file_chStdOut(model) 00206 00207 END SUBROUTINE shr_msg_chStdOut 00208 00209 !=============================================================================== 00210 00211 END MODULE shr_msg_mod