Line data Source code
1 : !-------------------------------------------------------------------------------- 2 : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany 3 : ! This file is part of FLEUR and available as free software under the conditions 4 : ! of the MIT license as expressed in the LICENSE file in more detail. 5 : !-------------------------------------------------------------------------------- 6 : 7 : MODULE m_nocoInputCheck 8 : 9 : CONTAINS 10 : 11 26 : SUBROUTINE nocoInputCheck(atoms,input,sym,vacuum,noco) 12 : 13 : USE m_juDFT 14 : USE m_constants 15 : USE m_types_atoms 16 : USE m_types_input 17 : USE m_types_sym 18 : USE m_types_vacuum 19 : USE m_types_noco 20 : USE m_sssym 21 : 22 : IMPLICIT NONE 23 : 24 : TYPE(t_atoms), INTENT(IN) :: atoms 25 : TYPE(t_input), INTENT(IN) :: input 26 : TYPE(t_sym), INTENT(IN) :: sym 27 : TYPE(t_vacuum), INTENT(IN) :: vacuum 28 : TYPE(t_noco), INTENT(IN) :: noco 29 : 30 : INTEGER itype 31 26 : LOGICAL l_relax_any,error(sym%nop) 32 : 33 : !---> make sure second variation is switched off 34 26 : IF (input%secvar) THEN 35 0 : WRITE (oUnit,*) 'This non-collinear version of the flapw program' 36 0 : WRITE (oUnit,*) 'cannot be used with the second variation!!' 37 0 : CALL juDFT_error("Second variation cannot be used!!!" ,calledby="nocoInputCheck") 38 : END IF 39 : 40 : !---> make sure histogram method is used 41 26 : IF (input%bz_integration==BZINT_METHOD_GAUSS) THEN 42 0 : WRITE (oUnit,*) 'This non-collinear version of the flapw program' 43 0 : WRITE (oUnit,*) 'cannot be used with the Gaussian smearing for ' 44 0 : WRITE (oUnit,*) 'the Brillouin zone integration!!' 45 0 : WRITE (oUnit,*) 'Please use the histogram method.' 46 0 : CALL juDFT_error("Only histogram Brillouin zone integration can be used!!!",calledby ="nocoInputCheck") 47 : END IF 48 : 49 : !---> make sure force is switched off 50 26 : IF (input%l_f) THEN 51 0 : WRITE (oUnit,*) 'This non-collinear version of the flapw program' 52 0 : WRITE (oUnit,*) 'does not support force calculations.' 53 0 : CALL juDFT_error("force calculations not supported!!!",calledby="nocoInputCheck") 54 : END IF 55 : 56 : 57 : !---> make sure starcoeff is switched off 58 : ! IF (starcoeff) THEN 59 : ! WRITE (oUnit,*) 'This non-collinear version of the flapw program' 60 : ! WRITE (oUnit,*) 'does not support starcoefficients output.' 61 : ! CALL juDFT_error("starcoefficients output (for STM) cannot be !!!" 62 : ! generated 63 : ! ENDIF 64 : 65 : !---> make sure coretails are switched off 66 26 : IF (input%ctail) THEN 67 0 : WRITE (oUnit,*) 'This non-collinear version of the flapw program' 68 0 : WRITE (oUnit,*) 'cannot be used with the coretail option!! ' 69 0 : CALL juDFT_error("Coretail option cannot be used!!!",hint="Set /calculationSetup/coreElectrons/@ctail to F in the FLEUR input file.",calledby="nocoInputCheck") 70 : END IF 71 : 72 : !---> make sure that moments are not relaxed and constrained 73 62 : l_relax_any = any(noco%l_alignMt.and.noco%l_constrained) 74 26 : IF (l_relax_any) THEN 75 0 : WRITE (oUnit,*)'The relaxation of the moment is switched on for at' 76 0 : WRITE (oUnit,*)'least one atom. At the same time the constrained' 77 0 : WRITE (oUnit,*)'moment option has been switched on!!!' 78 0 : CALL juDFT_error("You can not constrain and relax a magnetic moment simultaniously") 79 : ENDIF 80 : !---> make sure that perp. component of mag. is calculated if needed 81 62 : IF ( (l_relax_any .or. any(noco%l_constrained)) .and. (.not. noco%l_mperp) ) THEN 82 0 : WRITE (oUnit,*)'The relaxation of the moment is switched on for at' 83 0 : WRITE (oUnit,*)'least one atom or the constrained moment option is' 84 0 : WRITE (oUnit,*)'switched on. In either case, you need to set' 85 0 : WRITE (oUnit,*)'l_mperp=T !!' 86 0 : CALL juDFT_error("Stop: Set l_mperp = T to relax or constrain the moments!!",calledby ="nocoInputCheck") 87 : ENDIF 88 : !---> make sure l_constr is switched off in the case of spin spirals 89 62 : IF (any(noco%l_constrained) .and. noco%l_ss) THEN 90 0 : WRITE (oUnit,*)'The constraint moment option is not implemeted' 91 0 : WRITE (oUnit,*)'for spin spirals.' 92 0 : CALL juDFT_error("Stop: constraint not implemented for spin spirals!!",calledby ="nocoInputCheck") 93 : ENDIF 94 : 95 : IF((any(noco%l_unrestrictMT).OR.any(noco%l_spinoffd_ldau)) & 96 85 : .AND.atoms%n_hia+atoms%n_u>0.AND.sym%nop.NE.1) THEN 97 0 : CALL juDFT_warn("LDA+U and FullyFullyNoco with symmetries is not correctly implemented at the moment",calledby="nocoInputCheck") 98 : ENDIF 99 : 100 49 : IF(any(noco%l_unrestrictMT).AND.sym%nop.NE.1) THEN 101 1 : CALL juDFT_warn("FullyFullyNoco with symmetries might not deliver the desired results for you. This probably would require the implementation of magnetic space groups. ",calledby="nocoInputCheck") 102 : END IF 103 : 104 109 : IF(any(noco%l_unrestrictMT).AND.atoms%n_hia+atoms%n_u>0.AND.(.NOT.any(noco%l_alignMT))) THEN 105 0 : CALL juDFT_warn("LDA+U and FullyFullyNoco should only be used together with the l_RelaxSQA=T setting to achieve reasonable results.",calledby="nocoInputCheck") 106 : ENDIF 107 : 108 : !Warning on strange choice of switches 109 49 : IF (any(noco%l_unrestrictMT).AND..NOT.noco%l_mperp) THEN 110 0 : CALL juDFT_error("l_mperp='F' and l_mtNocoPot='T' makes no sense.",calledby='nocoInputCheck') 111 : END IF 112 : 113 26 : if (noco%l_ss) then 114 1 : CALL ss_sym(sym%nop,sym%mrot,noco%qss_inp,error) 115 2 : IF (ANY(error)) CALL judft_warn("Symmetry incompatible with Spin-Spiral") 116 1 : IF (ANY(noco%qss_inp(:).NE.0.0)) THEN 117 1 : IF(ALL(noco%beta_inp(:).EQ.0.0)) CALL juDFT_warn("No spin-spiral cone has a finite opening angle. Is this wanted?", hint='This is the beta angle.') 118 : END IF 119 : endif 120 : 121 62 : IF (any(noco%l_spinoffd_ldau).AND..NOT.noco%l_mperp) THEN 122 0 : CALL juDFT_error("l_spinoffd='T' for ldaU and l_mperp='F' makes no sense.",calledby='nocoInputCheck') 123 : END IF 124 : 125 62 : IF (any(noco%l_spinoffd_ldau).AND..NOT.noco%l_noco) THEN 126 0 : CALL juDFT_error("l_spinoffd='T' for ldaU and l_noco='F' makes no sense.",calledby='nocoInputCheck') 127 : END IF 128 : 129 26 : IF (noco%l_ss .and. noco%l_soc) THEN 130 0 : CALL juDFT_error("You use l_soc='T' and l_ss='T'.",hint="In a spin-spiral calculation SOC cannot be used. These are incompatible features. Please see the documentation for details.",calledby='nocoInputCheck') 131 : END IF 132 : 133 26 : END SUBROUTINE nocoInputCheck 134 : 135 : END MODULE m_nocoInputCheck