Changeset 1814 for trunk/LMDZ.TITAN/libf
- Timestamp:
- Oct 30, 2017, 11:04:45 AM (7 years ago)
- Location:
- trunk/LMDZ.TITAN/libf
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/muphytitan/argparse.F90
r1793 r1814 2065 2065 !! @warning 2066 2066 !! On error, the status of `values` is undefined. 2067 OBJECT(argparser), INTENT(in) :: this2068 !! An argparser object reference 2069 CHARACTER(len= *), INTENT(out), ALLOCATABLE, DIMENSION(:) :: values2067 OBJECT(argparser), INTENT(in) :: this 2068 !! An argparser object reference 2069 CHARACTER(len=st_slen), INTENT(out), ALLOCATABLE, DIMENSION(:) :: values 2070 2070 !! An allocatable vector of **assumed length** strings with the value(s) of all 2071 2071 !! positionals arguments found. … … 2779 2779 !! state is) which is the default value if no specific values are set in the argument. 2780 2780 !! Otherwise, `output` status is undefined. 2781 TYPE(argc), INTENT(in) :: this2781 TYPE(argc), INTENT(in) :: this 2782 2782 !! Argc object 2783 CHARACTER(len= *), INTENT(out), ALLOCATABLE, DIMENSION(:) :: output2783 CHARACTER(len=st_slen), INTENT(out), ALLOCATABLE, DIMENSION(:) :: output 2784 2784 !! Output values 2785 2785 TYPE(error) :: ret -
trunk/LMDZ.TITAN/libf/muphytitan/cfgparse.F90
r1793 r1814 803 803 IF (LEN_TRIM(zsname) == 0 ) zsname = "__default__" 804 804 fname = zsname//"/"//str_to_lower(TRIM(pname)) 805 !print*,"DEBUG6: ",fname806 805 IF (.NOT.cfg_check_name(fname)) THEN 807 806 err = error("Invalid option (no name)",-9) … … 872 871 ! no options yet -> allocate 873 872 ALLOCATE(this%options(1)) 874 !this%options(1) = sca875 !this%options(1)%name = pname876 !this%options(1)%section = zsname877 !this%options(1)%values = values878 873 ELSE 879 874 ! parser has options: increase this%options size (ugly copy). … … 890 885 ENDDO 891 886 DEALLOCATE(tmp) 892 !this%options(no+1) = sca893 !this%options(no+1)%name = pname894 !this%options(no+1)%section = zsname895 !this%options(no+1)%values = values896 887 ENDIF 897 888 ! always add the option at the end. 898 !print*, words_length(this%options(no+1)%values)899 889 this%options(no+1) = sca 900 890 CALL op_clear(sca) … … 1839 1829 EXIT 1840 1830 ENDIF 1841 !print*,"DEBUG0: New section ",TRIM(name), " <- ",isec1842 1831 isec = TRIM(name) 1843 1832 CASE(cfg_OPTION) … … 1849 1838 ! 4. update curval 1850 1839 IF (op_valid(curopt)) THEN 1851 !print*,"DEBUG3: new opt: ",TRIM(isec)//"/"//TRIM(name)," <- ",op_full_name(curopt)1852 1840 IF (LEN(curval) > 0) & 1853 1841 CALL words_extend(curopt%values,TRIM(ADJUSTL(curval)),space,.true.,.true.) -
trunk/LMDZ.TITAN/libf/muphytitan/errors.F90
r1793 r1814 84 84 CONTAINS 85 85 PROCEDURE, PUBLIC :: to_string => error_to_string 86 !! Get a string representation of the error87 !#if HAVE_FTNDTIO88 ! PROCEDURE, PRIVATE :: e_write_wfm89 ! PROCEDURE, PRIVATE :: e_write_wofm90 ! GENERIC, PUBLIC :: write(formatted) => e_write_wfm91 ! !! Generic formatted write statement subroutine interface92 ! GENERIC, PUBLIC :: write(unformatted) => e_write_wofm93 ! !! Generic unformatted write statement subroutine interface94 !#endif95 86 #endif 96 87 END TYPE error … … 201 192 END FUNCTION error_to_string 202 193 203 !#if HAVE_FTNDTIO204 ! SUBROUTINE e_write_wfm(dtv,unit,iotype,v_list,iostat,iomsg)205 ! !> Error derived type formatted IO write statement subroutine206 ! !!207 ! !! The method quietly ignores the derived type edit descriptor as the208 ! !! purpose of the subroutine is only to print a string. The edit descriptor209 ! !! used here is simply '(a)'.210 ! CLASS(error), INTENT(in) :: dtv211 ! !! A reference to the string object212 ! INTEGER, INTENT(in) :: unit213 ! !! Logical unit where to print the object214 ! CHARACTER (len=*), INTENT(in) :: iotype215 ! !! Type of IO216 ! INTEGER, INTENT(in) :: v_list(:)217 ! !! List of value from edit descriptor218 ! INTEGER, INTENT(out) :: iostat219 ! !! Error status code (set to 2 if dtv's value if not allocated)220 ! CHARACTER (len=*), INTENT(inout) :: iomsg221 ! !! Error message222 ! CHARACTER(len=15) :: i2s223 ! iostat = 0 ; iomsg = ""224 ! WRITE(i2s,'(I15)') dtv%id ; i2s=ADJUSTL(i2s)225 ! WRITE(unit, '(a)') 'error('//TRIM(i2s)//'): '//TRIM(dtv%msg)226 ! END SUBROUTINE e_write_wfm227 !228 ! SUBROUTINE e_write_wofm(dtv, unit, iostat, iomsg)229 ! !! Error type IO unformatted write statement subroutine230 ! CLASS(error), INTENT(in) :: dtv231 ! !! A reference to the string object232 ! INTEGER, INTENT(in) :: unit233 ! !! Logical unit where to print the object234 ! INTEGER, INTENT(out) :: iostat235 ! !! Error status code (set to 2 if dtv's value if not allocated)236 ! CHARACTER (len=*), INTENT(inout) :: iomsg237 ! !! Error message238 ! CHARACTER(len=15) :: i2s239 ! iostat = 0 ; iomsg = ""240 ! WRITE(i2s,'(I15)') dtv%id ; i2s=ADJUSTL(i2s)241 ! WRITE(unit, '(a)') 'error('//TRIM(i2s)//'): '//TRIM(dtv%msg)242 ! END SUBROUTINE e_write_wofm243 !#endif244 245 194 SUBROUTINE aborting(err) 246 195 !! Abort the program with specific exit code … … 252 201 IF (err /= 0) THEN 253 202 WRITE(*,'(a)') error_to_string(err) 254 CALL EXIT( err%id)203 CALL EXIT(abs(err%id)) 255 204 ENDIF 256 205 END SUBROUTINE aborting -
trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90
r1793 r1814 1438 1438 1439 1439 END MODULE MM_GLOBALS 1440 -
trunk/LMDZ.TITAN/libf/muphytitan/strings.F90
r1808 r1814 219 219 !! 220 220 !! @warning 221 !! It is always limited to strings::st_slencharacters.221 !! It is always limited to [[strings(module):st_slen(variable)]] characters. 222 222 CHARACTER(len=st_slen) :: value = '' 223 223 #endif … … 849 849 !! 850 850 !! The method attempts to convert the list of words in a vector of strings. 851 !! If _this_ list of words is empty the output vector is allocated with 0 elements and the method returns852 !! .false. . Otherwise it returns .true.851 !! If _this_ list of words is empty, the output vector is allocated with 0 elements and the method returns 852 !! .false., otherwise it returns .true. 853 853 !! @note 854 !! If the size of the output string vector (i.e. the character length of the string elements within the855 !! v ector) is too small, words canbe truncated.854 !! If elements in __this__ words object are wider than [[strings(module):st_slen(variable)]], output 855 !! values will be truncated. 856 856 OBJECT(words), INTENT(in) :: this 857 857 !! A words object reference … … 1041 1041 !! Quotes are removed only if they are the first and last non blank 1042 1042 !! characters. Either double and single quotes are stripped without distinction. 1043 !! The output string is trimmed from leading and trailing blank spaces 1043 !! The output string is trimmed from leading and trailing blank spaces (after quotes removal !) 1044 1044 CHARACTER(len=*), INTENT(in) :: str !! A string to check 1045 1045 CHARACTER(len=:), ALLOCATABLE :: ostr !! A string without external quotes (if any). … … 1053 1053 IF (i /= 1) i = 0 1054 1054 IF (j /= LEN(ostr)) j = LEN(ostr)+1 1055 ostr = ostr(i+1:j-1)1055 ostr = TRIM(ostr(i+1:j-1)) 1056 1056 RETURN 1057 1057 END FUNCTION remove_quotes … … 1624 1624 !! The function removes list of csi (ANSI escape sequences) from the given 1625 1625 !! string and returns a copy of it. 1626 !! @note1627 !! This method does not update @lerror.1628 1626 CHARACTER(len=*), INTENT(in) :: string 1629 1627 !! Input string -
trunk/LMDZ.TITAN/libf/phytitan/tracer_h.F90
r1795 r1814 288 288 DO i=1,size(indexes) 289 289 idx = indexes(i) 290 IF (idx < 1 .OR. idx > =nt) THEN290 IF (idx < 1 .OR. idx > nt) THEN 291 291 ! WRITE(*,'((a),I3,(a),I3,(a))') "index out of range (",idx,"/",nt,")" 292 292 CYCLE
Note: See TracChangeset
for help on using the changeset viewer.